Skip to content

Command::args_conflicts_with_subcommands

since 0.1.0

Specifies that use of an argument prevents the use of subcommands.

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" }
Terminal window
myprog test foo nested
Terminal window
error: the subcommand 'nested' cannot be used with '[input]'
Usage: myprog test [input]
myprog test <COMMAND>
For more information, try '--help'.