virt-admin: Make --timeout of daemon-timeout positional argument

We currently require full argument specification:

  virt-admin daemon-timeout --timeout X

Well, the '--timeout' feels a bit redundant. Turn the argument
into a positional so that the following works too:

  virt-admin daemon-timeout X

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik 2024-05-23 11:42:46 +02:00
parent 8877646665
commit a0c45432e0
2 changed files with 2 additions and 1 deletions

View File

@ -320,7 +320,7 @@ daemon-timeout
:: ::
daemon-timeout --timeout NUM daemon-timeout [--timeout] NUM
Sets the daemon timeout to the value of '--timeout' argument. Use ``--timeout 0`` Sets the daemon timeout to the value of '--timeout' argument. Use ``--timeout 0``
to disable auto-shutdown of the daemon. to disable auto-shutdown of the daemon.

View File

@ -1009,6 +1009,7 @@ static const vshCmdOptDef opts_daemon_timeout[] = {
{.name = "timeout", {.name = "timeout",
.type = VSH_OT_INT, .type = VSH_OT_INT,
.required = true, .required = true,
.positional = 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"),
}, },
{.name = NULL} {.name = NULL}