diff tools/packed.c @ 2408:60e119262c67

Option index re-ordering cleanup work.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 13 Jan 2020 21:21:25 +0200
parents b7cd5dd0b82e
children bc05bcfc4598
line wrap: on
line diff
--- a/tools/packed.c	Mon Jan 13 21:16:57 2020 +0200
+++ b/tools/packed.c	Mon Jan 13 21:21:25 2020 +0200
@@ -53,12 +53,13 @@
 
 static const DMOptArg optList[] =
 {
-    {  0, '?', "help",        "Show this help", OPT_NONE },
-    {  1, 'n', "nocompress",  "No compression / decompression", OPT_NONE },
-    {  2, 'C', "level",       "Set zlib compression level 1-9", OPT_ARGREQ },
-    {  3, 'v', "verbose",     "Increase verbosity", OPT_NONE },
-    {  4, 'f', "resflags",    "Set default resource flags (-f 0xff)", OPT_ARGREQ },
-    {  5, 'x', "exclude",     "Exclude name/glob pattern", OPT_ARGREQ },
+    {  0, '?', "help"            , "Show this help", OPT_NONE },
+    {  2, 'v', "verbose"         , "Be more verbose", OPT_NONE },
+
+    {  3, 'n', "nocompress"      , "No compression / decompression", OPT_NONE },
+    {  4, 'C', "level"           , "Set zlib compression level 1-9", OPT_ARGREQ },
+    {  5, 'f', "resflags"        , "Set default resource flags (-f 0xff)", OPT_ARGREQ },
+    {  6, 'x', "exclude"         , "Exclude name/glob pattern", OPT_ARGREQ },
 };
 
 static const int optListN = sizeof(optList) / sizeof(optList[0]);
@@ -102,11 +103,15 @@
             exit(0);
             break;
 
-        case 1:
+        case 2:
+            dmVerbosity++;
+            break;
+
+        case 3:
             optDoCompress = FALSE;
             break;
 
-        case 2:
+        case 4:
             optCompressLevel = atoi(optArg);
             if (optCompressLevel < 1 || optCompressLevel > 9)
             {
@@ -115,11 +120,7 @@
             }
             break;
 
-        case 3:
-            dmVerbosity++;
-            break;
-
-        case 4:
+        case 5:
             {
                 unsigned int tmpUI;
                 if (!dmGetIntVal(optArg, &tmpUI, NULL))
@@ -131,7 +132,7 @@
             }
             break;
 
-        case 5:
+        case 6:
             if (nexcFilenames < SET_MAX_FILES)
             {
                 excFilenames[nexcFilenames++] = optArg;
@@ -648,7 +649,7 @@
     DMPackFile *pack = NULL;
 
     // Parse arguments
-    dmInitProg("packed", "Pack File Editor", "0.7", NULL, NULL);
+    dmInitProg("packed", "TNSP Pack File Editor", "0.7", NULL, NULL);
     dmVerbosity = 0;
 
     if (!dmArgsProcess(argc, argv, optList, optListN,