Skip to content

ArgGroup::requires

since 0.1.0

Specify an argument or group that must be present when this group is.

name = "myprog"
[groups]
req_flags = { args = ["flag", "color"], requires = "debug" }
[args]
flag = { short = 'f', action = "set-true" }
color = { short = 'c', action = "set-true" }
debug = { short = 'd', action = "set-true" }
Terminal window
myprog -c
Terminal window
error: the following required arguments were not provided:
-d
Usage: myprog -d -c
For more information, try '--help'.