#shell-completion #completion #clap #manpage #generate-completions #clap-parser #arguments-parser

clap_allgen

The complete clap generation utility to give your command-line application users a more polished experience right out of the box

4 releases

0.2.1 Sep 16, 2024
0.2.0 Aug 13, 2024
0.1.1 Apr 9, 2024
0.1.0 Jan 9, 2024

#272 in Command-line interface

Download history 3/week @ 2024-08-21 67/week @ 2024-08-28 281/week @ 2024-09-04 477/week @ 2024-09-11 466/week @ 2024-09-18 526/week @ 2024-09-25 523/week @ 2024-10-02 569/week @ 2024-10-09 564/week @ 2024-10-16 418/week @ 2024-10-23 601/week @ 2024-10-30 394/week @ 2024-11-06 372/week @ 2024-11-13 357/week @ 2024-11-20 477/week @ 2024-11-27 382/week @ 2024-12-04

1,640 downloads per month
Used in 2 crates

Apache-2.0 OR MIT

12KB
91 lines

Clap All-Gen

CI Crates.io

The complete clap generation utility to give your command-line application users a more polished experience right out of the box.

This single crate integrates all other shell-specific crates to generate all the things at once.

Examples

To create all shell completions use the following command:

use clap_allgen::render_shell_completions;

#[derive(Debug, clap::Parser)]
enum Commands {
    First,
    Second,
    Third,
}

render_shell_completions::<Commands>("/tmp/shell-completions").expect("generation to work");

To generate man pages for your commands use:

use clap_allgen::render_manpages;

#[derive(Debug, clap::Parser)]
enum Commands {
    First,
    Second,
    Third,
}

render_manpages::<Commands>("/tmp/man-pages").expect("generation to work");

Features

Since the project is called clap_allgen it tries to generate completions for every shell that has a Rust crate.

For people who want to have more fine-grained control over dependencies that are pulled in, this crate offers a way to disable individual dependencies by using crate features.

By default all features are enabled so default-features = false is required to override it. Then, one can opt-in using the following features:

License

This project is licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.3–2.2MB
~41K SLoC