In at least one case we've wanted a mandatory argument which requires
the explicit flag. Fix the assumption before converting everything over
to the new flags.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
static const vshCmdOptDef opts_daemon_timeout[] = {
{.name = "timeout",
.type = VSH_OT_INT,
- .positional = true,
.required = true,
.help = N_("number of seconds the daemon will run without any active connection"),
.flags = VSH_OFLAG_REQ | VSH_OFLAG_REQ_OPT
opt->name, cmd->name);
return -1;
}
- seenPositionalOption = true;
- isPositional = true;
+
isRequired = true;
+
+ /* allow INT arguments which are required and non-positional */
+ if (!(opt->flags & VSH_OFLAG_REQ_OPT)) {
+ seenPositionalOption = true;
+ isPositional = true;
+ }
} else {
isPositional = false;
isRequired = false;