Command::subcommand_negates_reqs
subcommand_negates_reqs
Section titled “subcommand_negates_reqs ”Allows subcommands to override all requirements of the parent command.
Example
Section titled “Example”name = "myprog"subcommand-negates-reqs = true[args]opt = { long = "opt", required = true, action = "set" }[[subcommands]]name = "test"[subcommands.args]arg = { long = "arg", action = "set" }
name: myprogsubcommand-negates-reqs: trueargs: opt: long: opt required: true action: setsubcommands:- name: test args: arg: long: arg action: set
{ "name": "myprog", "subcommand-negates-reqs": true, "args": { "opt": { "long": "opt", "required": true, "action": "set" } }, "subcommands": [ { "name": "test", "args": { "arg": { "long": "arg", "action": "set" } } } ]}
myprog test --arg value
Output
Section titled “Output”claptrap__subcommand='test'claptrap_test_arg='value'