mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
vsh: Fix broken assumption that required VSH_OT_INT must be positional
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>
This commit is contained in:
parent
ac150162fd
commit
c53c064ef2
@ -1011,7 +1011,6 @@ static const vshCmdInfo info_daemon_log_outputs = {
|
|||||||
static const vshCmdOptDef opts_daemon_timeout[] = {
|
static const vshCmdOptDef opts_daemon_timeout[] = {
|
||||||
{.name = "timeout",
|
{.name = "timeout",
|
||||||
.type = VSH_OT_INT,
|
.type = VSH_OT_INT,
|
||||||
.positional = true,
|
|
||||||
.required = true,
|
.required = true,
|
||||||
.help = N_("number of seconds the daemon will run without any active connection"),
|
.help = N_("number of seconds the daemon will run without any active connection"),
|
||||||
.flags = VSH_OFLAG_REQ | VSH_OFLAG_REQ_OPT
|
.flags = VSH_OFLAG_REQ | VSH_OFLAG_REQ_OPT
|
||||||
|
@ -426,9 +426,14 @@ vshCmddefCheckInternals(vshControl *ctl,
|
|||||||
opt->name, cmd->name);
|
opt->name, cmd->name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
seenPositionalOption = true;
|
|
||||||
isPositional = true;
|
|
||||||
isRequired = true;
|
isRequired = true;
|
||||||
|
|
||||||
|
/* allow INT arguments which are required and non-positional */
|
||||||
|
if (!(opt->flags & VSH_OFLAG_REQ_OPT)) {
|
||||||
|
seenPositionalOption = true;
|
||||||
|
isPositional = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
isPositional = false;
|
isPositional = false;
|
||||||
isRequired = false;
|
isRequired = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user