# HG changeset patch # User Matti Hamalainen # Date 1578845078 -7200 # Node ID b6f88c15057375e1600029d1758ffce85e71dab9 # Parent 589bd78cc67d1724903ff8c7bdf79564c27937ac Use the newly added (in th-libs th_args module) option argument name field. diff -r 589bd78cc67d -r b6f88c150573 Makefile.gen --- 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/ diff -r 589bd78cc67d -r b6f88c150573 sidinfo.c --- 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 ", 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 ", 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]);