Command Line
Techniques to help create command line interfaces, such as argument parsers, line editing, or output coloring and formatting
Topic | Relevant Rust Crates |
---|---|
Argument Parsing | clap ⮳, structopt ⮳, argh ⮳ |
Interactive Prompts | dialoguer ⮳, console ⮳ |
Progress Bars | indicatif ⮳, pbr ⮳ |
Table Formatting | prettytable ⮳, term-table ⮳ |
Color Output | ansi_term ⮳, owo-colors ⮳ |
File System Operations | Use std::fs , pathdiff ⮳. |
Process Management | std::process |
Text Manipulation | regex ⮳, grep-cli ⮳, bat ⮳ (for cat like functionality) |
Configuration | config ⮳, serde ⮳ (for serialization) |
Logging | log ⮳, env_logger ⮳ |
Argument Parsing
FIXME
ANSI Terminal Handling
Recipe | Crates | Categories |
---|---|---|
ANSI Terminal | ||
Print Colored Text to the Terminal | ||
Print Bold Text to the Terminal | ||
Print Bold and Colored Text to the Terminal | ||
Manipulate the Cursor, Style the Output, Handle Input Events | ||
ansiterm | ||
anstream | ||
anstyle | ||
console | ||
owo-colors | ||
stylish | ||
termcolor | ||
yansi | ||
termion | ||
nu-ansi-term | [![nu-ansi-term][c-nu-ansi-term-badge]][c-nu-ansi-term] | |
colored |
FIXME
Terminal User Interfaces (TUI)
Recipe | Crates | Categories |
---|---|---|
Build Complex TUI |
User Interactions
Recipe | Crates | Categories |
---|---|---|
Ask for Confirmation, Selection, Text Input | ||
Display Progress Bars and Spinners |
Related Topics
- Command Line Utilities.
- Internationalization.
References
- Command Line Applications in Rust (book)⮳.
- Look to the Code⮳ for
Command-Line Rust
(O'Reilly, 2022, ISBN 9781098109417).