From a411656a98eede54ad5fb949059f48ddbf46e648 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 2 Jan 2016 22:31:33 -0500 Subject: argv.h: skip unavailable short/long option records with --help={short|long}. --- src/internal/argv/argv.h | 5 +++++ 1 file changed, 5 insertions(+) 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; -- cgit v1.2.3