Call read_secret to read a password without displaying it while being typed. WARNING: Password will be displayed for verification after it is typed.
(self, _)
| 100 | |
| 101 | @cmd2.with_category(EXAMPLE_COMMANDS) |
| 102 | def do_read_password(self, _) -> None: |
| 103 | """Call read_secret to read a password without displaying it while being typed. |
| 104 | |
| 105 | WARNING: Password will be displayed for verification after it is typed. |
| 106 | """ |
| 107 | self.poutput("The input will not be displayed on the screen") |
| 108 | try: |
| 109 | password = self.read_secret("Password: ") |
| 110 | self.poutput(f"You entered: {password}") |
| 111 | except EOFError: |
| 112 | pass |
| 113 | |
| 114 | def do_eat(self, arg): |
| 115 | """Example of using the select method for reading multiple choice input. |
nothing calls this directly
no test coverage detected