diff mbox series

[WIP,07/16] tools/xl: Sort list command options

Message ID 80f80b6bf5da09ceb332773b96f1dd554782b030.1608663694.git.ehem+xen@m5p.com (mailing list archive)
State New, archived
Headers show
Series Addition of formatting options to `xl list` subcommands | expand

Commit Message

Elliott Mitchell Dec. 9, 2020, 10:34 p.m. UTC
Simply a minor housekeeping task.  Unfortunately no single order really
dominates.  Some spots use the option name, some the option letter.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 tools/xl/xl_cmdtable.c |  4 ++--
 tools/xl/xl_list.c     | 22 +++++++++++-----------
 2 files changed, 13 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 6ab5e47da3..6a05bf7ce2 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -53,11 +53,11 @@  struct cmd_spec cmd_table[] = {
       &main_list, 0, 0,
       "List information about all/some domains",
       "[options] [Domain]\n",
-      "-l, --long              Output all VM details\n"
-      "-v, --verbose           Prints out UUIDs and security context\n"
       "-Z, --context           Prints out security context\n"
       "-c, --cpupool           Prints the cpupool the domain is in\n"
+      "-l, --long              Output all VM details\n"
       "-n, --numa              Prints out NUMA node affinity"
+      "-v, --verbose           Prints out UUIDs and security context\n"
     },
     { "destroy",
       &main_destroy, 0, 1,
diff --git a/tools/xl/xl_list.c b/tools/xl/xl_list.c
index ac6a9e5eac..8b391a9056 100644
--- a/tools/xl/xl_list.c
+++ b/tools/xl/xl_list.c
@@ -129,17 +129,17 @@  static void list_domains(bool verbose, bool context, bool claim, bool numa,
 int main_list(int argc, char **argv)
 {
     int opt;
-    bool verbose = false;
     bool context = false;
-    bool details = false;
     bool cpupool = false;
+    bool details = false;
     bool numa = false;
+    bool verbose = false;
     static struct option opts[] = {
-        {"long", 0, 0, 'l'},
-        {"verbose", 0, 0, 'v'},
         {"context", 0, 0, 'Z'},
         {"cpupool", 0, 0, 'c'},
+        {"long", 0, 0, 'l'},
         {"numa", 0, 0, 'n'},
+        {"verbose", 0, 0, 'v'},
         COMMON_LONG_OPTS
     };
 
@@ -147,22 +147,22 @@  int main_list(int argc, char **argv)
     libxl_dominfo *info, *info_free=0;
     int nb_domain, rc;
 
-    SWITCH_FOREACH_OPT(opt, "lvhZcn", opts, "list", 0) {
-    case 'l':
-        details = true;
-        break;
-    case 'v':
-        verbose = true;
-        break;
+    SWITCH_FOREACH_OPT(opt, "Zchlnv", opts, "list", 0) {
     case 'Z':
         context = true;
         break;
     case 'c':
         cpupool = true;
         break;
+    case 'l':
+        details = true;
+        break;
     case 'n':
         numa = true;
         break;
+    case 'v':
+        verbose = true;
+        break;
     }
 
     libxl_dominfo_init(&info_buf);