summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-01-02 22:31:33 -0500
committermidipix <writeonce@midipix.org>2016-01-02 22:32:02 -0500
commita411656a98eede54ad5fb949059f48ddbf46e648 (patch)
tree0c32ea3ef657ceec53ca520c04949f38c0eda2e4
parent8805b22d47ba930f6cd5d0aeaeebbb6d089b9eea (diff)
downloadsofort-a411656a98eede54ad5fb949059f48ddbf46e648.tar.bz2
sofort-a411656a98eede54ad5fb949059f48ddbf46e648.tar.xz
argv.h: skip unavailable short/long option records with --help={short|long}.
-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 dd6d18c..2eb75f2 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;