aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/arg_parser.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-01-07 21:29:27 +0100
committerJay Berkenbilt <ejb@ql.org>2022-01-30 19:11:03 +0100
commit53ba65eb59d0bced37e73d8bf96a0d7a7285f662 (patch)
tree29049c9c37ba25ea22313b83ac93e20a0a48b74b /libtests/arg_parser.cc
parenta301cc5373f14fd03e51619b0bd5fad22b84e115 (diff)
downloadqpdf-53ba65eb59d0bced37e73d8bf96a0d7a7285f662.tar.zst
QPDFArgParser: handle optional choices including help
Handle optional choices in addition to required choices. Refactor the way help options are added to completion to make it work with optional help choices.
Diffstat (limited to 'libtests/arg_parser.cc')
-rw-r--r--libtests/arg_parser.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libtests/arg_parser.cc b/libtests/arg_parser.cc
index a57b9c66..3da0206e 100644
--- a/libtests/arg_parser.cc
+++ b/libtests/arg_parser.cc
@@ -51,7 +51,7 @@ ArgParser::initOptions()
ap.addRequiredParameter("salad", p(&ArgParser::handleSalad), "tossed");
ap.addOptionalParameter("moo", p(&ArgParser::handleMoo));
char const* choices[] = {"pig", "boar", "sow", 0};
- ap.addRequiredChoices("oink", p(&ArgParser::handleOink), choices);
+ ap.addChoices("oink", p(&ArgParser::handleOink), true, choices);
ap.selectHelpOptionTable();
ap.addBare("version", [this](){ output("3.14159"); });
ap.selectMainOptionTable();