diff tools/data2inc.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 b153bc46241d
children bc05bcfc4598
line wrap: on
line diff
--- a/tools/data2inc.c	Mon Jan 13 21:16:57 2020 +0200
+++ b/tools/data2inc.c	Mon Jan 13 21:21:25 2020 +0200
@@ -53,17 +53,18 @@
 
 static const DMOptArg optList[] =
 {
-    {  0, '?', "help",           "Show this help", OPT_NONE },
-    {  1, 'n', "name",           "Set object name", OPT_ARGREQ },
-    {  2, 't', "type",           "Set datatype (unsigned char/byte)", OPT_ARGREQ },
-    {  3, 'f', "format",         "Set output format (see list below)", OPT_ARGREQ },
-    {  4, 'a', "add-line",       "Add this line to start of file", OPT_ARGREQ },
-    {  5, 'l', "line-items",     "Set number of items per line", OPT_ARGREQ },
-    {  6, 'x', "hexadecimal",    "Use hexadecimal output", OPT_NONE },
-    {  7, 'q', "quiet",          "Do not add comments", OPT_NONE },
-    {  8, 'N', "no-formatting",  "Disable additional output formatting", OPT_NONE },
-    {  9, 'i', "indentation",    "Set indentation (negative value = tab)", OPT_ARGREQ },
-    { 10, 'e', "extra-data",     "Add object end labels and size in asm output", OPT_NONE },
+    {  0, '?', "help"            , "Show this help", OPT_NONE },
+
+    { 10, 'n', "name"            , "Set object name", OPT_ARGREQ },
+    { 12, 't', "type"            , "Set datatype (unsigned char/byte)", OPT_ARGREQ },
+    { 14, 'f', "format"          , "Set output format (see list below)", OPT_ARGREQ },
+    { 16, 'a', "add-line"        , "Add this line to start of file", OPT_ARGREQ },
+    { 18, 'l', "line-items"      , "Set number of items per line", OPT_ARGREQ },
+    { 20, 'x', "hexadecimal"     , "Use hexadecimal output", OPT_NONE },
+    { 22, 'q', "quiet"           , "Do not add comments", OPT_NONE },
+    { 24, 'N', "no-formatting"   , "Disable additional output formatting", OPT_NONE },
+    { 26, 'i', "indentation"     , "Set indentation (negative value = tab)", OPT_ARGREQ },
+    { 28, 'e', "extra-data"      , "Add object end labels and size in asm output", OPT_NONE },
 };
 
 static const int optListN = sizeof(optList) / sizeof(optList[0]);
@@ -118,15 +119,15 @@
             exit(0);
             break;
 
-        case 1:
+        case 10:
             optObjName = optArg;
             break;
 
-        case 2:
+        case 12:
             optDataType = optArg;
             break;
 
-        case 3:
+        case 14:
             for (int i = 0; i < ndmFormatList; i++)
             {
                 const DMOutputFormat *fmt = &dmFormatList[i];
@@ -140,11 +141,11 @@
                 optArg);
             return FALSE;
 
-        case 4:
+        case 16:
             optAddLine = optArg;
             break;
 
-        case 5:
+        case 18:
             optLineLen = atoi(optArg);
             if (optLineLen < 1)
             {
@@ -154,24 +155,23 @@
             }
             break;
 
-
-        case 6:
+        case 20:
             optHexMode = TRUE;
             break;
 
-        case 7:
+        case 22:
             optQuiet = TRUE;
             break;
 
-        case 8:
+        case 24:
             optFormatting = FALSE;
             break;
 
-        case 9:
+        case 26:
             optIndentation = atoi(optArg);
             break;
 
-        case 10:
+        case 28:
             optExtraData = TRUE;
             break;
 
@@ -423,7 +423,7 @@
     int res;
 
     // Initialize
-    dmInitProg("data2inc", "Data to include converter", "0.7", NULL, NULL);
+    dmInitProg("data2inc", "Data to include file converter", "0.7", NULL, NULL);
     dmVerbosity = 0;
 
     // Parse arguments