summaryrefslogtreecommitdiffhomepage
path: root/src/internal/argv
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-01-02 22:34:08 -0500
committermidipix <writeonce@midipix.org>2016-11-10 23:35:35 -0500
commit527ec5de6bebce7d2ca9921e2d08a5e183d30e49 (patch)
tree3c98bcbb3f7d83d845b99caa6dd7c91f37a9bd95 /src/internal/argv
parent12240ebe83cfd45e3a482778de21e3621b2d6b23 (diff)
downloadperk-527ec5de6bebce7d2ca9921e2d08a5e183d30e49.tar.bz2
perk-527ec5de6bebce7d2ca9921e2d08a5e183d30e49.tar.xz
argv.h: skip unavailable short/long option records with --help={short|long}.
Diffstat (limited to 'src/internal/argv')
-rw-r--r--src/internal/argv/argv.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h
index c17f445..531f235 100644
--- a/src/internal/argv/argv.h
+++ b/src/internal/argv/argv.h
@@ -791,6 +791,11 @@ static void argv_usage(
desclen = 32;
for (option=options,buflen=0,rdesclen=1; option->short_name || option->long_name; option++) {
+ if (fshort && !option->short_name)
+ continue;
+ else if (flong && !option->long_name)
+ continue;
+
if (option->paradigm) {
if (option->optarg == ARGV_OPTARG_OPTIONAL)
rparalen = strlen(option->paradigm) - 2*rbblen;