Skip to content

ArgGroup::requires_all

since 0.1.0

Specify arguments or groups that must be present when this group is.

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