diff --git a/tools/virt-admin.c b/tools/virt-admin.c index d266d824cb..2e8895956d 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -1011,7 +1011,6 @@ static const vshCmdInfo info_daemon_log_outputs = { 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 diff --git a/tools/vsh.c b/tools/vsh.c index f059434b1a..33a9dcdfe8 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -426,9 +426,14 @@ vshCmddefCheckInternals(vshControl *ctl, 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;