aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/arg_parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libtests/arg_parser.cc')
-rw-r--r--libtests/arg_parser.cc34
1 files changed, 11 insertions, 23 deletions
diff --git a/libtests/arg_parser.cc b/libtests/arg_parser.cc
index c9474d55..fde00520 100644
--- a/libtests/arg_parser.cc
+++ b/libtests/arg_parser.cc
@@ -41,9 +41,7 @@ ArgParser::ArgParser(int argc, char* argv[]) :
void
ArgParser::initOptions()
{
- auto b = [this](void (ArgParser::*f)()) {
- return QPDFArgParser::bindBare(f, this);
- };
+ auto b = [this](void (ArgParser::*f)()) { return QPDFArgParser::bindBare(f, this); };
auto p = [this](void (ArgParser::*f)(std::string const&)) {
return QPDFArgParser::bindParam(f, this);
};
@@ -71,9 +69,7 @@ ArgParser::initOptions()
ap.addHelpFooter("For more help, read the manual.\n");
ap.addHelpTopic(
- "quack",
- "Quack Options",
- "Just put stuff after quack to get a count at the end.\n");
+ "quack", "Quack Options", "Just put stuff after quack to get a count at the end.\n");
ap.addHelpTopic(
"baaa",
"Baaa Options",
@@ -139,8 +135,7 @@ ArgParser::getQuack(std::string const& p)
{
++this->quacks;
if (this->ap.isCompleting() && (this->ap.argsLeft() == 0)) {
- this->ap.insertCompletion(
- std::string("thing-") + std::to_string(this->quacks));
+ this->ap.insertCompletion(std::string("thing-") + std::to_string(this->quacks));
return;
}
output(std::string("got quack: ") + p);
@@ -178,24 +173,17 @@ ArgParser::test_exceptions()
ap.selectOptionTable("baaa");
ap.addBare("ram", []() {});
});
- err("duplicate table",
- [this]() { ap.registerOptionTable("baaa", nullptr); });
+ err("duplicate table", [this]() { ap.registerOptionTable("baaa", nullptr); });
err("unknown table", [this]() { ap.selectOptionTable("aardvark"); });
- err("add existing help topic",
- [this]() { ap.addHelpTopic("baaa", "potato", "salad"); });
- err("add reserved help topic",
- [this]() { ap.addHelpTopic("all", "potato", "salad"); });
- err("add to unknown topic",
- [this]() { ap.addOptionHelp("--new", "oops", "potato", "salad"); });
- err("bad option for help",
- [this]() { ap.addOptionHelp("nodash", "baaa", "potato", "salad"); });
- err("bad topic for help",
- [this]() { ap.addHelpTopic("--dashes", "potato", "salad"); });
+ err("add existing help topic", [this]() { ap.addHelpTopic("baaa", "potato", "salad"); });
+ err("add reserved help topic", [this]() { ap.addHelpTopic("all", "potato", "salad"); });
+ err("add to unknown topic", [this]() { ap.addOptionHelp("--new", "oops", "potato", "salad"); });
+ err("bad option for help", [this]() { ap.addOptionHelp("nodash", "baaa", "potato", "salad"); });
+ err("bad topic for help", [this]() { ap.addHelpTopic("--dashes", "potato", "salad"); });
err("duplicate option help",
[this]() { ap.addOptionHelp("--ewe", "baaa", "potato", "salad"); });
- err("invalid choice handler to unknown", [this]() {
- ap.addInvalidChoiceHandler("elephant", [](std::string const&) {});
- });
+ err("invalid choice handler to unknown",
+ [this]() { ap.addInvalidChoiceHandler("elephant", [](std::string const&) {}); });
}
int