From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- vendor/clap/examples/cargo-example.md | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 vendor/clap/examples/cargo-example.md (limited to 'vendor/clap/examples/cargo-example.md') diff --git a/vendor/clap/examples/cargo-example.md b/vendor/clap/examples/cargo-example.md new file mode 100644 index 000000000..edf8ee18a --- /dev/null +++ b/vendor/clap/examples/cargo-example.md @@ -0,0 +1,38 @@ +For more on creating a custom subcommand, see [the cargo +book](https://doc.rust-lang.org/cargo/reference/external-tools.html#custom-subcommands). +The crate [`clap-cargo`](https://github.com/crate-ci/clap-cargo) can help in +mimicking cargo's interface. + +The help looks like: +```console +$ cargo-example --help +Usage: cargo + +Commands: + example A simple to use, efficient, and full-featured Command Line Argument Parser + help Print this message or the help of the given subcommand(s) + +Options: + -h, --help Print help + +$ cargo-example example --help +A simple to use, efficient, and full-featured Command Line Argument Parser + +Usage: cargo example [OPTIONS] + +Options: + --manifest-path + -h, --help Print help + -V, --version Print version + +``` + +Then to directly invoke the command, run: +```console +$ cargo-example example +None + +$ cargo-example example --manifest-path Cargo.toml +Some("Cargo.toml") + +``` -- cgit v1.2.3