Arg::long
since 0.1.0
Terminal window
Terminal window
Terminal window
Terminal window
Sets the long version of the argument without the preceding --
.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”name = "prog"[args]cfg = { long = "config", action = "set" }
name: progargs: cfg: long: config action: set
{ "name": "prog", "args": { "cfg": { "long": "config", "action": "set" } }}
prog --config file.toml
Output
Section titled “Output”claptrap_cfg='file.toml'
Example 2
Section titled “Example 2”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" }] }
name: progargs: mode: long: mode value-name: MODE help: Speed configuration default-value: fast value-parser: - name: fast - name: slow help: slower than fast
{ "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" } ] } }}
prog --help
Output
Section titled “Output”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')