Command::infer_subcommands
infer_subcommands
Section titled “infer_subcommands ”Allow partial matches of subcommand names and their aliases.
Example
Section titled “Example”name = "myprog"infer-subcommands = true[[subcommands]]name = "test"[subcommands.args]arg1 = { long = "arg1", action = "set-true" }
name: myproginfer-subcommands: truesubcommands:- name: test args: arg1: long: arg1 action: set-true
{ "name": "myprog", "infer-subcommands": true, "subcommands": [ { "name": "test", "args": { "arg1": { "long": "arg1", "action": "set-true" } } } ]}
myprog te --arg1
Output
Section titled “Output”claptrap__subcommand='test'claptrap_test_arg1='true'