Skip to content

Latest commit

 

History

History

examples

Collection of examples "how to use structopt"

How to append a postscript to the help message generated.

How to require presence of at least N values, like val1 val2 ... valN ... valM.

A basic example how to use structopt.

This is not an example but a test, it should be moved to tests folder as soon as this is fixed (if ever).

How to use doc comments in place of help/long_help.

How to use arg_enum! with StructOpt.

How to extract subcommands' args into external structs.

How to use environment variable fallback and how it interacts with default_value.

Somewhat complex example of usage of structopt.

How to use #[structopt(flatten)]

Generating bash completions with structopt.

Pseudo-git example, shows how to use subcommands and how to document them.

Using clap::Arg::group with structopt.

How to parse key=value pairs.

How to add no-thing flag which is true by default and false if passed.

How to completely remove version.

How #[structopt(rename_all)] works.

How to use #[structopt(required_if)].

How to use #[structopt(skip)].

How to use aliases

How to express ""true" or "false" argument.