changeset 322:5dfce66cc390

Reorder / clean up the commandline option indices.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 11 Jan 2020 22:37:02 +0200
parents 3bb2e0bdd1f0
children 063c4079eb50
files sidinfo.c
diffstat 1 files changed, 29 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/sidinfo.c	Sat Jan 11 21:58:45 2020 +0200
+++ b/sidinfo.c	Sat Jan 11 22:37:02 2020 +0200
@@ -120,20 +120,20 @@
 static const th_optarg optList[] =
 {
     {  0, '?', "help",       "Show this help", OPT_NONE },
-    { 10,   0, "license",    "Print out this program's license agreement", OPT_NONE },
-    {  1, 'v', "verbose",    "Be more verbose", OPT_NONE },
+    {  1,   0, "license",    "Print out this program's license agreement", OPT_NONE },
+    {  2, 'v', "verbose",    "Be more verbose", OPT_NONE },
 
-    {  2, 'p', "parsable",   "Output in script-parsable format", OPT_NONE },
+    {  3, 'p', "parsable",   "Output in script-parsable format", OPT_NONE },
+    {  4, 'x', "hex",        "Use hexadecimal values", OPT_NONE },
     {  5, 'n', "noprefix",   "Output without field name prefix", OPT_NONE },
     {  6, 'l', "line",       "Output in one line format, -l <field separator>", OPT_ARGREQ },
-    { 11, 'e', "escape",     "Escape these characters in fields (see note)", OPT_ARGREQ },
-    {  3, 'f', "fields",     "Show only specified field(s)", OPT_ARGREQ },
-    {  4, 'x', "hex",        "Use hexadecimal values", OPT_NONE },
-    {  7, 'F', "format",     "Use given format string (see below)", OPT_ARGREQ },
-    {  8, 'H', "hvsc",       "Specify path to HVSC root directory", OPT_ARGREQ },
-    {  9, 'S', "sldb",       "Specify Songlengths.(txt|md5) file", OPT_ARGREQ },
-    { 13, 'T', "stildb",     "Specify STIL.txt file", OPT_ARGREQ },
-    { 12, 'R', "recurse",    "Recurse into sub-directories", OPT_NONE },
+    {  7, 'e', "escape",     "Escape these characters in fields (see note)", OPT_ARGREQ },
+    {  8, 'f', "fields",     "Show only specified field(s)", OPT_ARGREQ },
+    {  9, 'F', "format",     "Use given format string (see below)", OPT_ARGREQ },
+    { 19, 'H', "hvsc",       "Specify path to HVSC root directory", OPT_ARGREQ },
+    { 11, 'S', "sldb",       "Specify Songlengths.(txt|md5) file", OPT_ARGREQ },
+    { 12, 'T', "stildb",     "Specify STIL.txt file", OPT_ARGREQ },
+    { 13, 'R', "recurse",    "Recurse into sub-directories", OPT_NONE },
 };
 
 static const int optListN = sizeof(optList) / sizeof(optList[0]);
@@ -632,24 +632,19 @@
         exit(0);
         break;
 
-    case 10:
+    case 1:
         sidutil_print_license();
         exit(0);
         break;
 
-    case 1:
+    case 2:
         th_verbosity++;
         break;
 
-    case 2:
+    case 3:
         optParsable = TRUE;
         break;
 
-    case 3:
-        if (!argParsePSFields(&optFormat, optArg))
-            return FALSE;
-        break;
-
     case 4:
         optHexadecimal = TRUE;
         break;
@@ -663,29 +658,33 @@
         break;
 
     case 7:
+        optEscapeChars = optArg;
+        break;
+
+    case 8:
+        if (!argParsePSFields(&optFormat, optArg))
+            return FALSE;
+        break;
+
+    case 9:
         optFieldOutput = FALSE;
-        optParsable = FALSE;
         if (!argParsePSFormatStr(&optFormat, optArg))
             return FALSE;
         break;
 
-    case 8:
+    case 10:
         th_pstr_cpy(&setHVSCPath, optArg);
         break;
 
-    case 9:
+    case 11:
         th_pstr_cpy(&setSLDBPath, optArg);
         break;
 
+    case 12:
+        th_pstr_cpy(&setSTILDBPath, optArg);
+        break;
+
     case 13:
-        th_pstr_cpy(&setSTILDBPath, optArg);
-        break;
-
-    case 11:
-        optEscapeChars = optArg;
-        break;
-
-    case 12:
         optRecurseDirs = TRUE;
         break;