]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Reorder some options
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 11 Nov 2014 09:45:24 +0000 (10:45 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 13 Nov 2014 14:44:23 +0000 (15:44 +0100)
According to comments in parsing functions, optional options should be
specified *after* required ones.  It makes sense and help output looks
cleaner.  The only exceptions are options with type == VSH_OT_ARGV.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
tools/virsh-domain.c
tools/virsh-pool.c
tools/virsh-volume.c

index 8e743f1415ffe50ad42070b26b44a7347dfde836..541363d8449b149e3f79a9d3763af5410cfb1247 100644 (file)
@@ -3222,11 +3222,6 @@ static const vshCmdOptDef opts_dom_pm_suspend[] = {
      .flags = VSH_OFLAG_REQ,
      .help = N_("domain name, id or uuid")
     },
-    {.name = "duration",
-     .type = VSH_OT_INT,
-     .flags = VSH_OFLAG_REQ_OPT,
-     .help = N_("duration in seconds")
-    },
     {.name = "target",
      .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
@@ -3234,6 +3229,11 @@ static const vshCmdOptDef opts_dom_pm_suspend[] = {
                 "disk(Suspend-to-Disk), "
                 "hybrid(Hybrid-Suspend)")
     },
+    {.name = "duration",
+     .type = VSH_OT_INT,
+     .flags = VSH_OFLAG_REQ_OPT,
+     .help = N_("duration in seconds")
+    },
     {.name = NULL}
 };
 
@@ -3940,10 +3940,6 @@ static const vshCmdInfo info_save[] = {
 };
 
 static const vshCmdOptDef opts_save[] = {
-    {.name = "bypass-cache",
-     .type = VSH_OT_BOOL,
-     .help = N_("avoid file system cache when saving")
-    },
     {.name = "domain",
      .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
@@ -3954,6 +3950,10 @@ static const vshCmdOptDef opts_save[] = {
      .flags = VSH_OFLAG_REQ,
      .help = N_("where to save the data")
     },
+    {.name = "bypass-cache",
+     .type = VSH_OT_BOOL,
+     .help = N_("avoid file system cache when saving")
+    },
     {.name = "xml",
      .type = VSH_OT_STRING,
      .help = N_("filename containing updated XML for the target")
@@ -4408,15 +4408,15 @@ static const vshCmdInfo info_managedsave[] = {
 };
 
 static const vshCmdOptDef opts_managedsave[] = {
-    {.name = "bypass-cache",
-     .type = VSH_OT_BOOL,
-     .help = N_("avoid file system cache when saving")
-    },
     {.name = "domain",
      .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
      .help = N_("domain name, id or uuid")
     },
+    {.name = "bypass-cache",
+     .type = VSH_OT_BOOL,
+     .help = N_("avoid file system cache when saving")
+    },
     {.name = "running",
      .type = VSH_OT_BOOL,
      .help = N_("set domain to be running on next start")
@@ -4918,6 +4918,16 @@ static const vshCmdInfo info_dump[] = {
 };
 
 static const vshCmdOptDef opts_dump[] = {
+    {.name = "domain",
+     .type = VSH_OT_DATA,
+     .flags = VSH_OFLAG_REQ,
+     .help = N_("domain name, id or uuid")
+    },
+    {.name = "file",
+     .type = VSH_OT_DATA,
+     .flags = VSH_OFLAG_REQ,
+     .help = N_("where to dump the core")
+    },
     {.name = "live",
      .type = VSH_OT_BOOL,
      .help = N_("perform a live core dump if supported")
@@ -4934,16 +4944,6 @@ static const vshCmdOptDef opts_dump[] = {
      .type = VSH_OT_BOOL,
      .help = N_("reset the domain after core dump")
     },
-    {.name = "domain",
-     .type = VSH_OT_DATA,
-     .flags = VSH_OFLAG_REQ,
-     .help = N_("domain name, id or uuid")
-    },
-    {.name = "file",
-     .type = VSH_OT_DATA,
-     .flags = VSH_OFLAG_REQ,
-     .help = N_("where to dump the core")
-    },
     {.name = "verbose",
      .type = VSH_OT_BOOL,
      .help = N_("display the progress of dump")
@@ -7452,6 +7452,11 @@ static const vshCmdOptDef opts_metadata[] = {
      .flags = VSH_OFLAG_REQ,
      .help = N_("domain name, id or uuid")
     },
+    {.name = "uri",
+     .type = VSH_OT_DATA,
+     .flags = VSH_OFLAG_REQ,
+     .help = N_("URI of the namespace")
+    },
     {.name = "live",
      .type = VSH_OT_BOOL,
      .help = N_("modify/get running state")
@@ -7468,11 +7473,6 @@ static const vshCmdOptDef opts_metadata[] = {
      .type = VSH_OT_BOOL,
      .help = N_("use an editor to change the metadata")
     },
-    {.name = "uri",
-     .type = VSH_OT_DATA,
-     .flags = VSH_OFLAG_REQ,
-     .help = N_("URI of the namespace")
-    },
     {.name = "key",
      .type = VSH_OT_DATA,
      .help = N_("key to be used as a namespace identifier"),
@@ -9269,6 +9269,16 @@ static const vshCmdInfo info_migrate[] = {
 };
 
 static const vshCmdOptDef opts_migrate[] = {
+    {.name = "domain",
+     .type = VSH_OT_DATA,
+     .flags = VSH_OFLAG_REQ,
+     .help = N_("domain name, id or uuid")
+    },
+    {.name = "desturi",
+     .type = VSH_OT_DATA,
+     .flags = VSH_OFLAG_REQ,
+     .help = N_("connection URI of the destination host as seen from the client(normal migration) or source(p2p migration)")
+    },
     {.name = "live",
      .type = VSH_OT_BOOL,
      .help = N_("live migration")
@@ -9341,16 +9351,6 @@ static const vshCmdOptDef opts_migrate[] = {
      .type = VSH_OT_BOOL,
      .help = N_("abort on soft errors during migration")
     },
-    {.name = "domain",
-     .type = VSH_OT_DATA,
-     .flags = VSH_OFLAG_REQ,
-     .help = N_("domain name, id or uuid")
-    },
-    {.name = "desturi",
-     .type = VSH_OT_DATA,
-     .flags = VSH_OFLAG_REQ,
-     .help = N_("connection URI of the destination host as seen from the client(normal migration) or source(p2p migration)")
-    },
     {.name = "migrateuri",
      .type = VSH_OT_DATA,
      .help = N_("migration URI, usually can be omitted")
index 0b8dba5f13ce24be8ae254a329f5b20d09fb8486..31f7ec3c90fe461b0b693830f8a6c3249a730cf3 100644 (file)
@@ -190,15 +190,15 @@ static const vshCmdOptDef opts_pool_X_as[] = {
      .flags = VSH_OFLAG_REQ,
      .help = N_("name of the pool")
     },
-    {.name = "print-xml",
-     .type = VSH_OT_BOOL,
-     .help = N_("print XML document, but don't define/create")
-    },
     {.name = "type",
      .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
      .help = N_("type of the pool")
     },
+    {.name = "print-xml",
+     .type = VSH_OT_BOOL,
+     .help = N_("print XML document, but don't define/create")
+    },
     {.name = "source-host",
      .type = VSH_OT_DATA,
      .help = N_("source-host for underlying storage")
index 4f810f8a176b782d66035528a74501df43dd8524..66d71aa1e7a3b1fdf4360c8d539aff2a5d8ddcb5 100644 (file)
@@ -1621,15 +1621,15 @@ static const vshCmdInfo info_vol_pool[] = {
 };
 
 static const vshCmdOptDef opts_vol_pool[] = {
-    {.name = "uuid",
-     .type = VSH_OT_BOOL,
-     .help = N_("return the pool uuid rather than pool name")
-    },
     {.name = "vol",
      .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
      .help = N_("volume key or path")
     },
+    {.name = "uuid",
+     .type = VSH_OT_BOOL,
+     .help = N_("return the pool uuid rather than pool name")
+    },
     {.name = NULL}
 };