summaryrefslogtreecommitdiffhomepage
path: root/src/internal/argv/argv.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/argv/argv.h')
-rw-r--r--src/internal/argv/argv.h28
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;