diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2017-04-05 03:12:33 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2017-04-05 03:12:33 +0000 |
commit | 186693cad32611f7f7cc95c842031d3091c6e6ab (patch) | |
tree | 0d74bf0bc42eff9775de3781e33ba6f74d4d054d /lib/util | |
parent | dd1729e780abf32158475f49e05380183f230a99 (diff) | |
download | netpbm-mirror-186693cad32611f7f7cc95c842031d3091c6e6ab.tar.gz netpbm-mirror-186693cad32611f7f7cc95c842031d3091c6e6ab.tar.xz netpbm-mirror-186693cad32611f7f7cc95c842031d3091c6e6ab.zip |
Document OPT_STRINGLIST
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2939 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/shhopt.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/util/shhopt.h b/lib/util/shhopt.h index 6b56bfd4..ecdf87d5 100644 --- a/lib/util/shhopt.h +++ b/lib/util/shhopt.h @@ -18,6 +18,7 @@ main ( int argc, char **argv ) { int height=7; int verbose_flag=7; int debug_flag=7; + char ** methodlist; struct optNameValue * optlist; optStruct3 opt; @@ -25,12 +26,13 @@ main ( int argc, char **argv ) { optEntry * option_def; MALLOCARRAY(option_def, 100); - OPTENT3(0, "help", OPT_FLAG, &help_flag, &help_spec, 0); - OPTENT3(0, "height", OPT_INT, &height, &height_spec, 0); - OPTENT3('n', "name", OPT_STRING, &name, &name_spec, 0); - OPTENT3('v', "verbose", OPT_FLAG, &verbose_flag, NULL, 0); - OPTENT3('g', "debug", OPT_FLAG, &debug_flag, NULL, 0); - OPTENT3(0, "options", OPT_NAMELIST, &optlist, NULL, 0); + OPTENT3(0, "help", OPT_FLAG, &help_flag, &help_spec, 0); + OPTENT3(0, "height", OPT_INT, &height, &height_spec, 0); + OPTENT3('n', "name", OPT_STRING, &name, &name_spec, 0); + OPTENT3('v', "verbose", OPT_FLAG, &verbose_flag, NULL, 0); + OPTENT3('g', "debug", OPT_FLAG, &debug_flag, NULL, 0); + OPTENT3(0, "methods", OPT_STRINGLIST, &methodlist, NULL, 0); + OPTENT3(0, "options", OPT_NAMELIST, &optlist, NULL, 0); opt.opt_table = option_def; opt.short_allowed = 1; @@ -50,6 +52,17 @@ main ( int argc, char **argv ) { printf("verbose_flag=%d\n", verbose_flag); printf("debug_flag=%d\n", verbose_flag); + if (methodlist) { + unsigned int i; + printf("methods: "); + while (methodlist[i]) { + printf("'%s', ", methodlist[i]); + ++i; + } + free(methodlist); + } else + printf("No -options\n"); + if (optlist) { unsigned int i; while (optlist[i].name) { |