]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vsh: Make the only argument of 'connect', 'cd', and 'help' commands positional
authorPeter Krempa <pkrempa@redhat.com>
Thu, 14 Mar 2024 15:58:40 +0000 (16:58 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 2 Apr 2024 12:24:29 +0000 (14:24 +0200)
The intended use of those commands is to use the argument directly
without the flag. Since the argument is optional in all cases we
couldn't declare them as positional until now.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tools/virsh.c
tools/virt-admin.c
tools/vsh.c

index 5b38881066c25dd5eea33dd400c2f5c13ff23cf5..890c96e5528fe51286a3128729f2669b5b3c8c47 100644 (file)
@@ -245,6 +245,7 @@ virshReconnect(vshControl *ctl, const char *name, bool readonly, bool force)
 static const vshCmdOptDef opts_connect[] = {
     {.name = "name",
      .type = VSH_OT_STRING,
+     .positional = true,
      .flags = VSH_OFLAG_EMPTY_OK,
      .completer = virshCompleteEmpty,
      .help = N_("hypervisor connection URI")
index 0766032e4ab7e085ac28d8c01c598ef5fe86ba94..6392caf854e2ad388c924be798814b4f7c01d15c 100644 (file)
@@ -254,6 +254,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
 static const vshCmdOptDef opts_connect[] = {
     {.name = "name",
      .type = VSH_OT_STRING,
+     .positional = true,
      .flags = VSH_OFLAG_EMPTY_OK,
      .help = N_("daemon's admin server connection URI")
     },
index 80057654c864372186ac89b50536727e4b59cdae..2c90ca44f777f2fbef434acfc2172520f4d5a968 100644 (file)
@@ -3163,6 +3163,7 @@ vshCompleteHelpCommand(vshControl *ctl G_GNUC_UNUSED,
 const vshCmdOptDef opts_help[] = {
     {.name = "command",
      .type = VSH_OT_STRING,
+     .positional = true,
      .completer = vshCompleteHelpCommand,
      .help = N_("Prints global help, command specific help, or help for a group of related commands")
     },
@@ -3220,6 +3221,7 @@ cmdHelp(vshControl *ctl, const vshCmd *cmd)
 const vshCmdOptDef opts_cd[] = {
     {.name = "dir",
      .type = VSH_OT_STRING,
+     .positional = true,
      .help = N_("directory to switch to (default: home or else root)")
     },
     {.name = NULL}