diff options
author | Jay Berkenbilt <ejb@ql.org> | 2023-05-21 19:35:09 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2023-05-21 19:35:09 +0200 |
commit | 60965d5f4d608bdccc2ffd4e8753e12cbbbd71d2 (patch) | |
tree | a707602da466c02ff1a54b3263c3a881cd7204a4 /libtests/arg_parser.cc | |
parent | 6b077332d38c093de2618d5e1481b42222106065 (diff) | |
download | qpdf-60965d5f4d608bdccc2ffd4e8753e12cbbbd71d2.tar.zst |
Rerun clang-format
Diffstat (limited to 'libtests/arg_parser.cc')
-rw-r--r-- | libtests/arg_parser.cc | 34 |
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 |