From 5489dc959720737031b98ea1bd43ee2690c02b9b Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Mon, 25 Dec 2017 23:52:22 +0100 Subject: [PATCH] Formatting change: Don't print space after elipsis in usage --- include/tclap/DocBookOutput.h | 4 +++- include/tclap/MultiArg.h | 2 +- include/tclap/MultiSwitchArg.h | 2 +- include/tclap/ZshCompletionOutput.h | 4 ++-- tests/test15.out | 6 +++--- tests/test16.out | 6 +++--- tests/test17.out | 6 +++--- tests/test22.out | 4 ++-- tests/test23.out | 4 ++-- tests/test24.out | 4 ++-- tests/test31.out | 6 +++--- tests/test32.out | 6 +++--- tests/test38.out | 2 +- tests/test39.out | 2 +- tests/test42.out | 6 +++--- tests/test44.out | 4 ++-- tests/test46.out | 2 +- tests/test49.out | 6 +++--- tests/test50.out | 6 +++--- tests/test51.out | 6 +++--- tests/test52.out | 6 +++--- tests/test53.out | 6 +++--- tests/test54.out | 6 +++--- tests/test57.out | 4 ++-- tests/test60.out | 2 +- tests/test66.out | 2 +- tests/test67.out | 2 +- 27 files changed, 59 insertions(+), 57 deletions(-) diff --git a/include/tclap/DocBookOutput.h b/include/tclap/DocBookOutput.h index e4c664a..5651253 100644 --- a/include/tclap/DocBookOutput.h +++ b/include/tclap/DocBookOutput.h @@ -134,7 +134,7 @@ inline void DocBookOutput::usage(CmdLineInterface& _cmd ) std::cout << "" << std::endl; } - + // rest of args for (ArgListIterator it = argList.begin(); it != argList.end(); it++) if ( !xorHandler.contains( (*it) ) ) @@ -242,6 +242,7 @@ inline void DocBookOutput::printShortArg(Arg* a) removeChar(arg,']'); removeChar(arg,'<'); removeChar(arg,'>'); + removeChar(arg,'.'); arg.erase(0, arg.find_last_of(theDelimiter) + 1); std::cout << theDelimiter; std::cout << "" << arg << ""; @@ -280,6 +281,7 @@ inline void DocBookOutput::printLongArg(Arg* a) removeChar(arg,']'); removeChar(arg,'<'); removeChar(arg,'>'); + removeChar(arg,'.'); arg.erase(0, arg.find_last_of(theDelimiter) + 1); std::cout << theDelimiter; std::cout << "" << arg << ""; diff --git a/include/tclap/MultiArg.h b/include/tclap/MultiArg.h index 943db76..4a2ec65 100644 --- a/include/tclap/MultiArg.h +++ b/include/tclap/MultiArg.h @@ -359,7 +359,7 @@ template std::string MultiArg::shortID(const std::string& val) const { static_cast(val); // Ignore input, don't warn - return Arg::shortID(_typeDesc) + " ... "; + return Arg::shortID(_typeDesc) + " ..."; } /** diff --git a/include/tclap/MultiSwitchArg.h b/include/tclap/MultiSwitchArg.h index d6f92eb..8ea713b 100644 --- a/include/tclap/MultiSwitchArg.h +++ b/include/tclap/MultiSwitchArg.h @@ -190,7 +190,7 @@ inline bool MultiSwitchArg::processArg(int *i, std::vector& args) inline std::string MultiSwitchArg::shortID(const std::string& val) const { - return Arg::shortID(val) + " ... "; + return Arg::shortID(val) + " ..."; } inline std::string diff --git a/include/tclap/ZshCompletionOutput.h b/include/tclap/ZshCompletionOutput.h index acf655b..8c89773 100644 --- a/include/tclap/ZshCompletionOutput.h +++ b/include/tclap/ZshCompletionOutput.h @@ -237,8 +237,8 @@ inline void ZshCompletionOutput::printOption(Arg* a, std::string mutex) if ( a->isValueRequired() ) { std::string arg = a->shortID(); - // Example arg: "[-A ] ... " - size_t pos = arg.rfind(" ... "); + // Example arg: "[-A ] ..." + size_t pos = arg.rfind(" ..."); if (pos != std::string::npos) { arg.erase(pos); } diff --git a/tests/test15.out b/tests/test15.out index f79dfc1..e817436 100644 --- a/tests/test15.out +++ b/tests/test15.out @@ -2,9 +2,9 @@ PARSE ERROR: Argument: (--stringTest) Couldn't find delimiter for this argument! Brief USAGE: - ../examples/test3 [-f=] ... [-i=] ... - --stringTest= [-B] [--] [--version] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... --stringTest= + [-B] [--] [--version] [-h] + ... For complete USAGE and HELP type: ../examples/test3 --help diff --git a/tests/test16.out b/tests/test16.out index f79dfc1..e817436 100644 --- a/tests/test16.out +++ b/tests/test16.out @@ -2,9 +2,9 @@ PARSE ERROR: Argument: (--stringTest) Couldn't find delimiter for this argument! Brief USAGE: - ../examples/test3 [-f=] ... [-i=] ... - --stringTest= [-B] [--] [--version] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... --stringTest= + [-B] [--] [--version] [-h] + ... For complete USAGE and HELP type: ../examples/test3 --help diff --git a/tests/test17.out b/tests/test17.out index 37f86c3..343a5d5 100644 --- a/tests/test17.out +++ b/tests/test17.out @@ -2,9 +2,9 @@ PARSE ERROR: Required argument missing: unTest2 Brief USAGE: - ../examples/test3 [-f=] ... [-i=] ... - --stringTest= [-B] [--] [--version] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... --stringTest= + [-B] [--] [--version] [-h] + ... For complete USAGE and HELP type: ../examples/test3 --help diff --git a/tests/test22.out b/tests/test22.out index 76153be..f6669d9 100644 --- a/tests/test22.out +++ b/tests/test22.out @@ -3,8 +3,8 @@ PARSE ERROR: Argument: -b (--bbb) Brief USAGE: ../examples/test5 {-a |-b } {--eee |--fff - |-g } {-i ... |-j - ... } [--ddd] -c [--] [--version] [-h] + |-g } {-i ...|-j + ...} [--ddd] -c [--] [--version] [-h] For complete USAGE and HELP type: ../examples/test5 --help diff --git a/tests/test23.out b/tests/test23.out index 74cae53..4a008d1 100644 --- a/tests/test23.out +++ b/tests/test23.out @@ -3,8 +3,8 @@ PARSE ERROR: Argument: -d Brief USAGE: ../examples/test5 {-a |-b } {--eee |--fff - |-g } {-i ... |-j - ... } [--ddd] -c [--] [--version] [-h] + |-g } {-i ...|-j + ...} [--ddd] -c [--] [--version] [-h] For complete USAGE and HELP type: ../examples/test5 --help diff --git a/tests/test24.out b/tests/test24.out index 76153be..f6669d9 100644 --- a/tests/test24.out +++ b/tests/test24.out @@ -3,8 +3,8 @@ PARSE ERROR: Argument: -b (--bbb) Brief USAGE: ../examples/test5 {-a |-b } {--eee |--fff - |-g } {-i ... |-j - ... } [--ddd] -c [--] [--version] [-h] + |-g } {-i ...|-j + ...} [--ddd] -c [--] [--version] [-h] For complete USAGE and HELP type: ../examples/test5 --help diff --git a/tests/test31.out b/tests/test31.out index 6853a57..7e3e9a1 100644 --- a/tests/test31.out +++ b/tests/test31.out @@ -2,9 +2,9 @@ PARSE ERROR: Argument: -i (--intTest) Couldn't read argument value from string '9a' Brief USAGE: - ../examples/test3 [-f=] ... [-i=] ... - --stringTest= [-B] [--] [--version] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... --stringTest= + [-B] [--] [--version] [-h] + ... For complete USAGE and HELP type: ../examples/test3 --help diff --git a/tests/test32.out b/tests/test32.out index 7d717ed..021f1b8 100644 --- a/tests/test32.out +++ b/tests/test32.out @@ -2,9 +2,9 @@ PARSE ERROR: Argument: -f (--floatTest) More than one valid value parsed from string '1.0.0' Brief USAGE: - ../examples/test3 [-f=] ... [-i=] ... - --stringTest= [-B] [--] [--version] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... --stringTest= + [-B] [--] [--version] [-h] + ... For complete USAGE and HELP type: ../examples/test3 --help diff --git a/tests/test38.out b/tests/test38.out index c06b9f3..d0b0cfb 100644 --- a/tests/test38.out +++ b/tests/test38.out @@ -9,7 +9,7 @@ Brief USAGE: ] [-x ] [-s ] [-d] [-g ] [-f ] -n ... [--] + |marge|bart|lisa|maggie> ... [--] [--version] [-h] <1|2|3> ... For complete USAGE and HELP type: diff --git a/tests/test39.out b/tests/test39.out index bec5c3b..1850094 100644 --- a/tests/test39.out +++ b/tests/test39.out @@ -9,7 +9,7 @@ Brief USAGE: ] [-x ] [-s ] [-d] [-g ] [-f ] -n ... [--] + |marge|bart|lisa|maggie> ... [--] [--version] [-h] <1|2|3> ... For complete USAGE and HELP type: diff --git a/tests/test42.out b/tests/test42.out index 4c95064..5cb8427 100644 --- a/tests/test42.out +++ b/tests/test42.out @@ -1,9 +1,9 @@ USAGE: - ../examples/test3 [-f=] ... [-i=] ... - --stringTest= [-B] [--] [--version] [-h] - ... + ../examples/test3 [-f=] ... [-i=] ... --stringTest= + [-B] [--] [--version] [-h] + ... Where: diff --git a/tests/test44.out b/tests/test44.out index f246109..3363e1e 100644 --- a/tests/test44.out +++ b/tests/test44.out @@ -2,8 +2,8 @@ USAGE: ../examples/test5 {-a |-b } {--eee |--fff - |-g } {-i ... |-j - ... } [--ddd] -c [--] [--version] [-h] + |-g } {-i ...|-j + ...} [--ddd] -c [--] [--version] [-h] Where: diff --git a/tests/test46.out b/tests/test46.out index 8981c67..dfb67d9 100644 --- a/tests/test46.out +++ b/tests/test46.out @@ -8,7 +8,7 @@ USAGE: ] [-x ] [-s ] [-d] [-g ] [-f ] -n ... [--] + |marge|bart|lisa|maggie> ... [--] [--version] [-h] <1|2|3> ... diff --git a/tests/test49.out b/tests/test49.out index f38c950..5e85eb4 100644 --- a/tests/test49.out +++ b/tests/test49.out @@ -2,9 +2,9 @@ PARSE ERROR: Argument: -s (--stringTest) Couldn't find delimiter for this argument! Brief USAGE: - ../examples/test8 [-f=] ... [-i=] ... -s= [-B] - [--] [--version] [-h] - ... + ../examples/test8 [-f=] ... [-i=] ... -s= [-B] [--] + [--version] [-h] + ... For complete USAGE and HELP type: ../examples/test8 --help diff --git a/tests/test50.out b/tests/test50.out index f38c950..5e85eb4 100644 --- a/tests/test50.out +++ b/tests/test50.out @@ -2,9 +2,9 @@ PARSE ERROR: Argument: -s (--stringTest) Couldn't find delimiter for this argument! Brief USAGE: - ../examples/test8 [-f=] ... [-i=] ... -s= [-B] - [--] [--version] [-h] - ... + ../examples/test8 [-f=] ... [-i=] ... -s= [-B] [--] + [--version] [-h] + ... For complete USAGE and HELP type: ../examples/test8 --help diff --git a/tests/test51.out b/tests/test51.out index e957e5c..077714f 100644 --- a/tests/test51.out +++ b/tests/test51.out @@ -2,9 +2,9 @@ PARSE ERROR: Required argument missing: unTest2 Brief USAGE: - ../examples/test8 [-f=] ... [-i=] ... -s= [-B] - [--] [--version] [-h] - ... + ../examples/test8 [-f=] ... [-i=] ... -s= [-B] [--] + [--version] [-h] + ... For complete USAGE and HELP type: ../examples/test8 --help diff --git a/tests/test52.out b/tests/test52.out index aaf4e18..89df1f5 100644 --- a/tests/test52.out +++ b/tests/test52.out @@ -2,9 +2,9 @@ PARSE ERROR: Argument: -i (--intTest) Couldn't read argument value from string '9a' Brief USAGE: - ../examples/test8 [-f=] ... [-i=] ... -s= [-B] - [--] [--version] [-h] - ... + ../examples/test8 [-f=] ... [-i=] ... -s= [-B] [--] + [--version] [-h] + ... For complete USAGE and HELP type: ../examples/test8 --help diff --git a/tests/test53.out b/tests/test53.out index e791c7f..d2e03c0 100644 --- a/tests/test53.out +++ b/tests/test53.out @@ -2,9 +2,9 @@ PARSE ERROR: Argument: -f (--floatTest) More than one valid value parsed from string '1.0.0' Brief USAGE: - ../examples/test8 [-f=] ... [-i=] ... -s= [-B] - [--] [--version] [-h] - ... + ../examples/test8 [-f=] ... [-i=] ... -s= [-B] [--] + [--version] [-h] + ... For complete USAGE and HELP type: ../examples/test8 --help diff --git a/tests/test54.out b/tests/test54.out index 9837b22..ec7077e 100644 --- a/tests/test54.out +++ b/tests/test54.out @@ -1,9 +1,9 @@ USAGE: - ../examples/test8 [-f=] ... [-i=] ... -s= [-B] - [--] [--version] [-h] - ... + ../examples/test8 [-f=] ... [-i=] ... -s= [-B] [--] + [--version] [-h] + ... Where: diff --git a/tests/test57.out b/tests/test57.out index eabdc27..cd51b85 100644 --- a/tests/test57.out +++ b/tests/test57.out @@ -3,8 +3,8 @@ PARSE ERROR: Argument: -i (--iii) Brief USAGE: ../examples/test5 {-a |-b } {--eee |--fff - |-g } {-i ... |-j - ... } [--ddd] -c [--] [--version] [-h] + |-g } {-i ...|-j + ...} [--ddd] -c [--] [--version] [-h] For complete USAGE and HELP type: ../examples/test5 --help diff --git a/tests/test60.out b/tests/test60.out index d96dcea..d669a46 100644 --- a/tests/test60.out +++ b/tests/test60.out @@ -4,7 +4,7 @@ PARSE ERROR: Argument: -r (--reverse) USAGE: - ../examples/test9 [-N] ... [-V] ... [-r] [--] + ../examples/test9 [-N] ... [-V] ... [-r] [--] Where: diff --git a/tests/test66.out b/tests/test66.out index 507762b..db7f81a 100644 --- a/tests/test66.out +++ b/tests/test66.out @@ -2,7 +2,7 @@ PARSE ERROR: Required argument missing: vect Brief USAGE: - ../examples/test12 -v <3D vector> ... [--] [--version] [-h] + ../examples/test12 -v <3D vector> ... [--] [--version] [-h] For complete USAGE and HELP type: ../examples/test12 --help diff --git a/tests/test67.out b/tests/test67.out index dccc0ab..545fa3f 100644 --- a/tests/test67.out +++ b/tests/test67.out @@ -2,7 +2,7 @@ PARSE ERROR: Argument: -v (--vect) a 1 0.3 is not a 3D vector Brief USAGE: - ../examples/test12 -v <3D vector> ... [--] [--version] [-h] + ../examples/test12 -v <3D vector> ... [--] [--version] [-h] For complete USAGE and HELP type: ../examples/test12 --help