From 29f3ac42235b88c1d018494523d76968617972f4 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 13 Mar 2024 23:01:18 +0100 Subject: [PATCH] virsh: snapshot: Make 'snapshotname' argument positional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'snapshotname' argument is optional as by default "current" snapshot is considered. Regardless of that we should treat it as positional as it's the common usage. This is now possible as we can have one optional positional argument. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- tools/virsh-snapshot.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 638333f4d6..6c8194d67f 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -486,6 +486,7 @@ static const vshCmdOptDef opts_snapshot_edit[] = { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name = "snapshotname", .type = VSH_OT_STRING, + .positional = true, .help = N_("snapshot name"), .completer = virshSnapshotNameCompleter, }, @@ -599,6 +600,7 @@ static const vshCmdOptDef opts_snapshot_current[] = { }, {.name = "snapshotname", .type = VSH_OT_STRING, + .positional = true, .help = N_("name of existing snapshot to make current"), .completer = virshSnapshotNameCompleter, }, @@ -798,6 +800,7 @@ static const vshCmdOptDef opts_snapshot_info[] = { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name = "snapshotname", .type = VSH_OT_STRING, + .positional = true, .help = N_("snapshot name"), .completer = virshSnapshotNameCompleter, }, @@ -1635,6 +1638,7 @@ static const vshCmdOptDef opts_snapshot_parent[] = { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name = "snapshotname", .type = VSH_OT_STRING, + .positional = true, .help = N_("find parent of snapshot name"), .completer = virshSnapshotNameCompleter, }, @@ -1682,6 +1686,7 @@ static const vshCmdOptDef opts_snapshot_revert[] = { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name = "snapshotname", .type = VSH_OT_STRING, + .positional = true, .help = N_("snapshot name"), .completer = virshSnapshotNameCompleter, }, @@ -1763,6 +1768,7 @@ static const vshCmdOptDef opts_snapshot_delete[] = { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT), {.name = "snapshotname", .type = VSH_OT_STRING, + .positional = true, .help = N_("snapshot name"), .completer = virshSnapshotNameCompleter, },