clap-doc

Crates.ioclap-doc
lib.rsclap-doc
version
sourcesrc
created_at2024-09-17 13:06:33.141244
updated_at2024-12-10 16:18:15.547841
descriptionCreate markdown descriptions for `clap::Command`s
homepagehttps://crates.io/crates/clap-doc/
repositoryhttps://github.com/aatifsyed/clap-doc/
max_upload_size
id1377416
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Aatif Syed (aatifsyed)

documentation

https://docs.rs/clap-doc/

README

clap-doc

Create markdown descriptions for [clap::Command]s.

So given the following rust code:

/// Rust's package manager
#[derive(clap::Parser)]
#[command(name = "cargo")]
enum Cargo {
    /// Compile a local package and all of its dependencies
    Build {
        /// Build artifacts in release mode, with optimizations
        #[arg(short, long)]
        release: bool,
    },
    /// Run a binary or example of the local package
    Run {
        /// Arguments for the binary or example to run
        args: Vec<String>,
    },
    /// Remove artifacts that cargo has generated in the past
    Clean,
}

You get the markdown that follows, with subcommands handled as you'd expect.

cargo

Rust's package manager

Usage: cargo <COMMAND>

Commands:
  build  Compile a local package and all of its dependencies
  run    Run a binary or example of the local package
  clean  Remove artifacts that cargo has generated in the past

cargo build

Compile a local package and all of its dependencies

Usage: cargo build [OPTIONS]

Options:
  -r, --release
          Build artifacts in release mode, with optimizations

cargo run

Run a binary or example of the local package

Usage: cargo run [ARGS]...

Arguments:
  [ARGS]...
          Arguments for the binary or example to run

cargo clean

Remove artifacts that cargo has generated in the past

Usage: cargo clean
Commit count: 7

cargo fmt