Command::args_conflicts_with_subcommands
args_conflicts_with_subcommands
Section titled “args_conflicts_with_subcommands ”Specifies that use of an argument prevents the use of subcommands.
Example
Section titled “Example”name = "myprog"[args]foo = { short = 'f' }[[subcommands]]name = "test"args-conflicts-with-subcommands = true[subcommands.args]input = { help = "the file to add" }[[subcommands.subcommands]]name = "nested"about = "A nested sub command"[subcommands.subcommands.args]arg3 = { long = "arg3" }
name: myprogargs: foo: short: fsubcommands:- name: test args-conflicts-with-subcommands: true args: input: help: the file to add subcommands: - name: nested about: A nested sub command args: arg3: long: arg3
{ "name": "myprog", "args": { "foo": { "short": "f" } }, "subcommands": [ { "name": "test", "args-conflicts-with-subcommands": true, "args": { "input": { "help": "the file to add" } }, "subcommands": [ { "name": "nested", "about": "A nested sub command", "args": { "arg3": { "long": "arg3" } } } ] } ]}
myprog test foo nested
Output
Section titled “Output”error: the subcommand 'nested' cannot be used with '[input]'
Usage: myprog test [input] myprog test <COMMAND>
For more information, try '--help'.