1
0
Fork 0
rust-terminal-prompt/README.md
Daniel Baumann 7f48381065
Adding upstream version 0.2.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-02-05 06:17:43 +01:00

18 lines
540 B
Markdown

# terminal-prompt
Tiny library for prompting sensitive or non-sensitive data on the terminal.
The only dependency is `libc` on Unix and `winapi` on Windows.
See [`Terminal`] for the API documentation.
## Example
Read a username and password from the terminal:
```rust
use terminal_prompt::Terminal;
let mut terminal = Terminal::open()?;
let username = terminal.prompt("Username: ")?;
let password = terminal.prompt_sensitive("Password: ")?;
```
[`Terminal`]: https://docs.rs/terminal-prompt/latest/terminal_prompt/struct.Terminal.html