Skip to content

ArgGroup::required

since 0.1.0

Require an argument from the group to be present when parsing.

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