Terse CLI
A wrapper around clap that lets you build CLI applications with very little boilerplate code.
Modeled after tiangolo's typer python library, you simply define your commands and subcommands as functions and annotate them with the #[command] attribute.
Current Status: Alpha
This is a work in progress. The core functionality is implemented, but if you want any customization on how your CLI is used (e.g. positional arguments, custom help messages, etc.) those things are not yet supported.
Known issues:
- every command must have a return type that implements
Display - positional arguments are not yet supported
- argument docs are not yet supported
Installation
Install both clap and terse_cli:
Example
Below snippet is from ./example/main.rs.
use Parser;
use ;
/// Example: cargo run -- command-one --a 3
/// Example: cargo run -- my-subcommands command-two --name Bob
/// Example: cargo run -- my-subcommands command-three --a 7 --b 3
/// Example: cargo run -- my-subcommands command-four
subcommands!;
subcommands!;
// you can also use `--help` as you would expect
// Example: cargo run -- my-subcommands --help