ArgGroup::required
required
Section titled “required ”Require an argument from the group to be present when parsing.
Example
Section titled “Example”name = "myprog"[groups]req_flags = { args = ["flag", "color"], required = true }[args]flag = { short = 'f', action = "set-true" }color = { short = 'c', action = "set-true" }
name: myproggroups: req_flags: args: - flag - color required: trueargs: flag: short: f action: set-true color: short: c action: set-true
{ "name": "myprog", "groups": { "req_flags": { "args": [ "flag", "color" ], "required": true } }, "args": { "flag": { "short": "f", "action": "set-true" }, "color": { "short": "c", "action": "set-true" } }}
myprog
Output
Section titled “Output”error: the following required arguments were not provided: <-f|-c>
Usage: myprog <-f|-c>
For more information, try '--help'.