changeset 327:b6f88c150573

Use the newly added (in th-libs th_args module) option argument name field.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 12 Jan 2020 18:04:38 +0200
parents 589bd78cc67d
children 04ed43ef97e7
files Makefile.gen sidinfo.c
diffstat 2 files changed, 17 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.gen	Sun Jan 12 04:18:51 2020 +0200
+++ b/Makefile.gen	Sun Jan 12 18:04:38 2020 +0200
@@ -1,6 +1,8 @@
+CFLAGS += -W -Wall -Wextra -std=c99 -pedantic -I./ -D_XOPEN_SOURCE=500
 CFLAGS += -g
 CFLAGS += -O2
-CFLAGS += -W -Wall -Wextra -std=c99 -pedantic -I./ -D_XOPEN_SOURCE=500
+#CFLAGS += -flto
+CFLAGS += -DTH_USE_OPT_ARG=1
 THLIBS = th-libs/
 
 
--- a/sidinfo.c	Sun Jan 12 04:18:51 2020 +0200
+++ b/sidinfo.c	Sun Jan 12 18:04:38 2020 +0200
@@ -119,21 +119,21 @@
 // Define option arguments
 static const th_optarg optList[] =
 {
-    {  0, '?', "help",       "Show this help", OPT_NONE },
-    {  1,   0, "license",    "Print out this program's license agreement", OPT_NONE },
-    {  2, 'v', "verbose",    "Be more verbose", OPT_NONE },
+    {  0, '?', "help"     , NULL     , "Show this help", OPT_NONE },
+    {  1,   0, "license"  , NULL     , "Print out this program's license agreement", OPT_NONE },
+    {  2, 'v', NULL       , NULL     , "Be more verbose", 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 },
-    {  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 },
+    {  3, 'p', "parsable" , NULL     , "Output in script-parsable format", OPT_NONE },
+    {  4, 'x', "hex"      , NULL     , "Use hexadecimal values", OPT_NONE },
+    {  5, 'n', "noprefix" , NULL     , "Output without field name prefix", OPT_NONE },
+    {  6, 'l', "line"     , "sep"    , "Output in one line format, -l <field sep str>", OPT_ARGREQ },
+    {  7, 'e', "escape"   , "chars"  , "Escape these characters in fields (see note)", OPT_ARGREQ },
+    {  8, 'f', "fields"   , "fields" , "Show only specified field(s)", OPT_ARGREQ },
+    {  9, 'F', "format"   , "fmt"    , "Use given format string (see below)", OPT_ARGREQ },
+    { 19, 'H', "hvsc"     , "path"   , "Specify path to HVSC root directory", OPT_ARGREQ },
+    { 11, 'S', "sldb"     , "file"   , "Specify Songlengths.(txt|md5) file", OPT_ARGREQ },
+    { 12, 'T', "stildb"   , "file"   , "Specify STIL.txt file", OPT_ARGREQ },
+    { 13, 'R', "recurse"  , NULL     , "Recurse into sub-directories", OPT_NONE },
 };
 
 static const int optListN = sizeof(optList) / sizeof(optList[0]);