diff options
author | midipix <writeonce@midipix.org> | 2016-03-06 06:39:27 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-11-11 00:22:37 -0500 |
commit | e5adae4007f3e8d36d4eaa072899a4f790acb320 (patch) | |
tree | 5eb683c009cdf28fb1c23677e0aafc08fa9e4541 /src | |
parent | d81b54b567dfc593dcc3f16a5cce61b78b869439 (diff) | |
download | mdso-e5adae4007f3e8d36d4eaa072899a4f790acb320.tar.bz2 mdso-e5adae4007f3e8d36d4eaa072899a4f790acb320.tar.xz |
argv.h: usage screen generator: give <argname> priority over <paradigm>.
Diffstat (limited to 'src')
-rw-r--r-- | src/internal/argv/argv.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h index 884ed14..e425ebd 100644 --- a/src/internal/argv/argv.h +++ b/src/internal/argv/argv.h @@ -780,10 +780,10 @@ static void argv_usage( if (len > optlen) optlen = len; - if (option->paradigm) - len = strlen(option->paradigm) + strlen("{}"); - else if (option->argname) + if (option->argname) len = strlen(option->argname); + else if (option->paradigm) + len = strlen(option->paradigm) + strlen("{}"); else if (option->optarg != ARGV_OPTARG_NONE) len = strlen("<val>"); @@ -899,7 +899,17 @@ static void argv_usage( } } - if (option->paradigm && (rparalen <= paralen)) { + if (option->argname) { + if (option->optarg == ARGV_OPTARG_OPTIONAL) + fprintf(file,"[%s]%-*c", + option->argname, + (int)(paralen-strlen(option->argname)-brcklen),' '); + else + fprintf(file,"%s%-*c", + option->argname, + (int)(paralen-strlen(option->argname)),' '); + para = (char *)0; + } else if (option->paradigm && (rparalen <= paralen)) { if (option->optarg == ARGV_OPTARG_OPTIONAL) fprintf(file,"[{%s}]%-*c", option->paradigm, @@ -923,16 +933,6 @@ static void argv_usage( fputc('{',file); rparalen = paralen - rblen; } - } else if (option->argname) { - if (option->optarg == ARGV_OPTARG_OPTIONAL) - fprintf(file,"[%s]%-*c", - option->argname, - (int)(paralen-strlen(option->argname)-brcklen),' '); - else - fprintf(file,"%s%-*c", - option->argname, - (int)(paralen-strlen(option->argname)),' '); - para = (char *)0; } else { fprintf(file,"%-*c",(int)paralen,' '); para = (char *)0; |