Crates.io | cli-rs |
lib.rs | cli-rs |
version | 0.1.13 |
source | src |
created_at | 2023-07-19 22:08:25.810637 |
updated_at | 2024-02-16 00:49:28.661374 |
description | create clis with sophisticated completions |
homepage | |
repository | |
max_upload_size | |
id | 920758 |
size | 42,814 |
🚧 wip 🚧
A library to help you quickly write expressive CLIs. Built from the ground up with advanced features like dynamic completions in mind.
Command::name("lockbook")
.subcommand(
Command::name("edit")
.input(Arg::new("target"))
.handler(|target: Arg<String>| println!("editing target file: {}", target.get())),
)
.parse();
Specify complicated arguments that are used often:
let docs = Arg::<Uuid>::new("target-file")
.description("A uuid or path of a lockbook document")
.parser(|str| {...})
.completions(|current_str, cursor_loc| {...});
cli-rs will automatically generate contextual help messages, and man pages. cli-rs will also generate a tiny completions file for every shell which will call your CLI, moving as much of the completion logic into Rust as possible.
command_path --flags positional_args --flags positional_args
things for now
--key=value
--key
, --key=false
, or -k
things for later:
--key value
-rf