Skip to content

Arg::long

since 0.1.0

Sets the long version of the argument without the preceding --.

name = "prog"
[args]
cfg = { long = "config", action = "set" }
Terminal window
prog --config file.toml
Terminal window
claptrap_cfg='file.toml'
name = "prog"
[args]
mode = { long = "mode", value-name = "MODE", help = "Speed configuration", default-value = "fast", value-parser = [{ name = "fast" }, { name = "slow", help = "slower than fast" }] }
Terminal window
prog --help
Terminal window
Usage: prog [OPTIONS]
Options:
--mode <MODE>
Speed configuration
Possible values:
- fast
- slow: slower than fast
[default: fast]
-h, --help
Print help (see a summary with '-h')