Clientele.rs
Clientele makes it easy to write superb command-line utilities in Rust
that follow consistent best practices on all target platforms including Linux,
macOS, and Windows. It packages and re-exports clap, camino,
dotenvy, wild, argfile, and getenv into a single easy
dependency.
✨ Features
- Showcases how to structure a CLI program in Rust (see the examples).
- Loads environment variables from
.envfiles (using thedotenvycrate). - Provides convenience getters for common variables (using the
getenvcrate). - Expands wildcard arguments (globs) on Windows (using the
wildcrate). - Expands @argfiles similarly to
javacor Python (using theargfilecrate). - Defines a standard set of essential CLI options (using the
clapcrate). - Provides the
Utf8PathandUtf8PathBuftypes (using thecaminocrate). - Recommends use of the
sysexits.h(3)exit codes (seesysexits.rs). - Supports opting out of any feature using comprehensive feature flags.
- Adheres to the Rust API Guidelines in its naming conventions.
- 100% free and unencumbered public domain software.
🛠️ Prerequisites
- Rust 1.81+
⬇️ Installation
Installation via Cargo
Installation in Cargo.toml (with all features enabled)
[]
= "0.3"
Installation in Cargo.toml (with only specific features enabled)
[]
= { = "0.3", = false, = ["dotenv"] }
👉 Examples
See lib/clientele/examples/skeleton/main.rs for a complete example.
Importing the library
use *;
Running the example
📚 Reference
Options
StandardOptions
Options:
--color <COLOR> Set the color output mode [default: auto] [possible values: auto, always, never]
-d, --debug Enable debugging output
--license Show license information
-v, --verbose... Enable verbose output (may be repeated for more verbosity)
-V, --version Print version information
-h, --help Print help
👨💻 Development