diff options
author | midipix <writeonce@midipix.org> | 2016-01-02 22:28:59 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-01-02 22:29:29 -0500 |
commit | 69a773273c39942c6c48a60e3fcf1a95657663cc (patch) | |
tree | 487a03d4d907907fa00c3828dbaf0e2d869bf02c /src/internal/argv | |
parent | 6b0a2b107c62845cd457d0a3a060e38006b8630f (diff) | |
download | apimagic-69a773273c39942c6c48a60e3fcf1a95657663cc.tar.bz2 apimagic-69a773273c39942c6c48a60e3fcf1a95657663cc.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.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h index a8c7269..f47dbc2 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; |