summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-06 07:07:33 -0500
committermidipix <writeonce@midipix.org>2016-11-10 23:35:39 -0500
commit52f6630f3dd47aee2adaa65b8101cf42d4e0d29f (patch)
tree25a1ccb8a3a50c50cfdb8fb31006a5d678c65d7a /src
parent40e279fbebbe8aa1a18c2d498e635e364aeee37f (diff)
downloadperk-52f6630f3dd47aee2adaa65b8101cf42d4e0d29f.tar.bz2
perk-52f6630f3dd47aee2adaa65b8101cf42d4e0d29f.tar.xz
argv.h: usage screen generator: fix notation of purely hybrid options.
Diffstat (limited to 'src')
-rw-r--r--src/internal/argv/argv.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h
index 4b9c13b..7c60990 100644
--- a/src/internal/argv/argv.h
+++ b/src/internal/argv/argv.h
@@ -858,17 +858,27 @@ static void argv_usage(
if (fshort)
fprintf(file,"%s-%-*c",indent,(int)(optlen-solen),option->short_name);
else if (flong)
- fprintf(file,"%s--%-*s",indent,(int)(optlen-lolen),option->long_name);
+ fprintf(file,
+ (option->flags & ARGV_OPTION_HYBRID_ONLY)
+ ? "%s -%-*s"
+ : "%s--%-*s",
+ indent,(int)(optlen-lolen),option->long_name);
else {
if (option->short_name && option->long_name)
- fprintf(file,"%s-%c,--%-*s",
+ fprintf(file,
+ (option->flags & ARGV_OPTION_HYBRID_ONLY)
+ ? "%s-%c, -%-*s"
+ : "%s-%c,--%-*s",
indent,option->short_name,
(int)(optlen-slolen),option->long_name);
else if (option->short_name)
fprintf(file,"%s-%-*c",
indent,(int)(optlen-solen),option->short_name);
else
- fprintf(file,"%s%3s--%-*s",
+ fprintf(file,
+ (option->flags & ARGV_OPTION_HYBRID_ONLY)
+ ? "%s%3s -%-*s"
+ : "%s%3s--%-*s",
indent,"",
(int)(optlen-slolen),option->long_name);
}