Arg::global
global
Section titled “global ”Specifies that an argument can be matched to all child Subcommands.
Example
Section titled “Example”name = "prog"[args]verb = { long = "verbose", short = 'v', action = "set-true", global = true }[[subcommands]]name = "test"[[subcommands]]name = "do-stuff"
name: progargs: verb: long: verbose short: v action: set-true global: truesubcommands:- name: test- name: do-stuff
{ "name": "prog", "args": { "verb": { "long": "verbose", "short": "v", "action": "set-true", "global": true } }, "subcommands": [ { "name": "test" }, { "name": "do-stuff" } ]}
prog do-stuff --verbose
Output
Section titled “Output”claptrap__subcommand='do-stuff'claptrap_verb='true'