Expand description
§cli-battery-pack
A battery pack for building CLI applications in Rust.
§What’s Included
| Crate | What it does |
|---|---|
| anstream | Auto-detecting stream for terminal color support |
| anstyle | ANSI text styling |
| anstyle-hyperlink | ANSI hyperlink support |
| supports-hyperlinks | Detect terminal hyperlink support |
| anyhow | Ergonomic error handling for applications |
| clap | Command-line argument parsing with derive macros |
| colorchoice-clap | Clap argument for controlling color output |
| wild | Glob argument expansion (for Windows compatibility) |
| dialoguer | Interactive prompts and user input |
| human-panic | Human-friendly panic messages |
§Dev dependencies
| Crate | What it does |
|---|---|
| snapbox | Snapshot testing for CLI commands |
§Optional features
- indicators:
indicatiffor progress bars,consolefor terminal styling - search:
regexfor pattern matching,ignorefor gitignore-aware file walking - config:
etceterafor platform-native configuration directories
§Quick Start
cargo bp add cliWant progress bars too?
cargo bp add cli -F indicators§License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
| Crate | Version | Description |
|---|---|---|
| anstream | 1.0.0 | IO stream adapters for writing colored text that will gracefully degrade according to your terminal’s capabilities. |
| anstyle | 1.0.14 | ANSI text styling |
| anstyle-hyperlink | 1.0.2 | ANSI escape code hyperlinks (OSC 8) |
| anyhow | 1 | Flexible concrete Error type built on std::error::Error |
| clap | 4 | A simple to use, efficient, and full-featured Command Line Argument Parser |
| colorchoice-clap | 1.0.8 | Clap mixin to override console colors |
| console | 0.15 | A terminal and console abstraction for Rust |
| dialoguer | 0.11 | A command line prompting library. |
| etcetera | 0.11.0 | |
| human-panic | 2.0.8 | Panic messages for humans |
| ignore | 0.4 | |
| indicatif | 0.17 | |
| regex | 1 | |
| snapbox | 1.2.1 | Snapshot testing toolbox |
| supports-hyperlinks | 3.2.0 | Detects whether a terminal supports rendering hyperlinks. |
| wild | 2.2.1 | Glob (wildcard) expanded command-line arguments on Windows |
Functions§
- validate
- Validate that the consumer’s dependencies match this battery pack’s specs.