Arg::value_parser
value_parser
Section titled “value_parser ”Specify the typed behavior of the argument.
Example
Section titled “Example”name = "raw"[args]color = { long = "color", value-parser = ["always", "auto", "never"], default-value = "auto" }
name: rawargs: color: long: color value-parser: - always - auto - never default-value: auto
{ "name": "raw", "args": { "color": { "long": "color", "value-parser": [ "always", "auto", "never" ], "default-value": "auto" } }}
prog --color auto
Output
Section titled “Output”claptrap_color='auto'