mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 05:18:16 +08:00
Custom mask for secret (#970)
* Masking Character added, not yet used. * Setting the masking character can be chained with other extensions. * Added string extension for masking, and replaced hardcoded asterisks. * Check if mask is null first. * Fixed Typo in previous test and added new test for custom masks. * Added tests for masking with null character * Added docs and example. * Adjusted extensions so that Mask is integrated into Secret extension. Updated Exampls and Tests accordingly
This commit is contained in:
@ -63,6 +63,23 @@ What's the secret number? _
|
||||
|
||||
```text
|
||||
Enter password: ************_
|
||||
```
|
||||
|
||||
## Masks
|
||||
|
||||
<?# Example symbol="M:Prompt.Program.AskPasswordWithCustomMask" project="Prompt" /?>
|
||||
|
||||
|
||||
```text
|
||||
Enter password: ------------_
|
||||
```
|
||||
|
||||
You can utilize a null character to completely hide input.
|
||||
|
||||
<?# Example symbol="M:Prompt.Program.AskPasswordWithNullMask" project="Prompt" /?>
|
||||
|
||||
```text
|
||||
Enter password: _
|
||||
```
|
||||
|
||||
## Optional
|
||||
|
Reference in New Issue
Block a user