4 ms·
Yeah, I was hoping the `clap` macros would perform some unthinkable magic there... I will have to update the help with a listing. In the mean time, have a look
by moses-palmer 3y ago
Yeah, I was hoping the `clap` macros would perform some unthinkable magic there... I will have to update the help with a listing.
In the mean time, have a look here[1] for the possible values.
[1]: https://github.com/moses-palmer/labyru/blob/7b92be3ae279a9ff752b2b266da7725e59c69811/maze/src/initialize/mod.rs#L107 https://github.com/moses-palmer/labyru/blob/7b92be3ae279a9ff...
- linkdd 3y ago`clap` does have magic for enums: use clap::{Parser, ValueEnum}; #[derive(ValueEnum, Debug, Clone)] pub enum Foo { Bar, Baz, } #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] pub struct Args { /// description #[arg(short = 'f', long = "foo", value_enum, default_value = "bar")] foo: Foo, } The output of `--help` will look like: -f, --foo <FOO> description [default: bar] [possible values: bar, baz] This is with clap >= 4.4 with the derive feature.