From 0980af54f2f2f588b78f843d64f3cbfac3831554 Mon Sep 17 00:00:00 2001 From: Mike Smoot Date: Sun, 22 May 2011 11:50:16 -0700 Subject: [PATCH 01/13] added patch to fix brief output with TCLAP_NAMESTRING defined --- include/tclap/StdOutput.h | 3 ++- tests/Makefile.am | 6 ++++-- tests/runtests.sh | 2 +- tests/test63.sh | 0 tests/test64.sh | 0 tests/test65.sh | 0 tests/test66.sh | 0 tests/test67.sh | 0 tests/test79.out | 9 +++++++++ tests/test79.sh | 11 +++++++++++ 10 files changed, 27 insertions(+), 4 deletions(-) mode change 100644 => 100755 tests/test63.sh mode change 100644 => 100755 tests/test64.sh mode change 100644 => 100755 tests/test65.sh mode change 100644 => 100755 tests/test66.sh mode change 100644 => 100755 tests/test67.sh create mode 100644 tests/test79.out create mode 100755 tests/test79.sh diff --git a/include/tclap/StdOutput.h b/include/tclap/StdOutput.h index 35f7b99..944cff4 100644 --- a/include/tclap/StdOutput.h +++ b/include/tclap/StdOutput.h @@ -143,7 +143,8 @@ inline void StdOutput::failure( CmdLineInterface& _cmd, _shortUsage( _cmd, std::cerr ); std::cerr << std::endl << "For complete USAGE and HELP type: " - << std::endl << " " << progName << " --help" + << std::endl << " " << progName << " " + << Arg::nameStartString() << "help" << std::endl << std::endl; } else diff --git a/tests/Makefile.am b/tests/Makefile.am index 4c0f409..179f80f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -77,7 +77,8 @@ TESTS = test1.sh \ test75.sh \ test76.sh \ test77.sh \ - test78.sh + test78.sh \ + test79.sh EXTRA_DIST = $(TESTS) \ test1.out \ @@ -157,6 +158,7 @@ EXTRA_DIST = $(TESTS) \ test75.out \ test76.out \ test77.out \ - test78.out + test78.out \ + test79.out CLEANFILES = tmp.out diff --git a/tests/runtests.sh b/tests/runtests.sh index e4e64e4..b0ad68f 100644 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -2,7 +2,7 @@ let "suc = 0" let "fail = 0" -NUMTEST=67 +NUMTEST=79 for (( tno = 1 ; $tno <= $NUMTEST ; tno = $tno + 1 )); do ./testCheck.sh $tno diff --git a/tests/test63.sh b/tests/test63.sh old mode 100644 new mode 100755 diff --git a/tests/test64.sh b/tests/test64.sh old mode 100644 new mode 100755 diff --git a/tests/test65.sh b/tests/test65.sh old mode 100644 new mode 100755 diff --git a/tests/test66.sh b/tests/test66.sh old mode 100644 new mode 100755 diff --git a/tests/test67.sh b/tests/test67.sh old mode 100644 new mode 100755 diff --git a/tests/test79.out b/tests/test79.out new file mode 100644 index 0000000..9e7b467 --- /dev/null +++ b/tests/test79.out @@ -0,0 +1,9 @@ +PARSE ERROR: + Required argument missing: name + +Brief USAGE: + ../examples/test21 [/r] /n [//] [~~version] [/h] + +For complete USAGE and HELP type: + ../examples/test21 ~~help + diff --git a/tests/test79.sh b/tests/test79.sh new file mode 100755 index 0000000..62f5c02 --- /dev/null +++ b/tests/test79.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# success +../examples/test21 > tmp.out 2>&1 + +if cmp -s tmp.out $srcdir/test79.out; then + exit 0 +else + exit 1 +fi + From ad5345dfb7f1db2b6932792ebda8148520abaf27 Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Thu, 17 May 2012 22:12:35 +0200 Subject: [PATCH 02/13] Initialize theDelimiter (supress warning), found by test23. --- include/tclap/DocBookOutput.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/tclap/DocBookOutput.h b/include/tclap/DocBookOutput.h index a42ca27..f4ac34d 100644 --- a/include/tclap/DocBookOutput.h +++ b/include/tclap/DocBookOutput.h @@ -68,6 +68,7 @@ class DocBookOutput : public CmdLineOutput virtual void failure(CmdLineInterface& c, ArgException& e ); + DocBookOutput() : theDelimiter('=') {} protected: /** From 221a79bf1778d6657fa9d0dcfbc2fff8d5d318cb Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Thu, 24 Aug 2017 21:44:33 +0100 Subject: [PATCH 03/13] Fix } outside of include guards You get an extra brace if ArgTraits.h ends up included more than once https://sourceforge.net/p/tclap/patches/13/ --- include/tclap/ArgTraits.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/tclap/ArgTraits.h b/include/tclap/ArgTraits.h index 0b2c18f..e894d75 100644 --- a/include/tclap/ArgTraits.h +++ b/include/tclap/ArgTraits.h @@ -82,6 +82,7 @@ struct ArgTraits { //typedef ValueLike ValueCategory; }; +} // namespace + #endif -} // namespace From 4c04f3e965317a488429f72444a150327ce33356 Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Sat, 2 Sep 2017 15:58:29 +0100 Subject: [PATCH 04/13] Fixed typo --- include/tclap/Arg.h | 2 +- include/tclap/ArgException.h | 2 +- include/tclap/ArgTraits.h | 2 +- include/tclap/CmdLine.h | 2 +- include/tclap/CmdLineInterface.h | 2 +- include/tclap/CmdLineOutput.h | 2 +- include/tclap/Constraint.h | 2 +- include/tclap/DocBookOutput.h | 2 +- include/tclap/HelpVisitor.h | 2 +- include/tclap/IgnoreRestVisitor.h | 2 +- include/tclap/MultiArg.h | 2 +- include/tclap/MultiSwitchArg.h | 2 +- include/tclap/OptionalUnlabeledTracker.h | 2 +- include/tclap/StandardTraits.h | 2 +- include/tclap/StdOutput.h | 2 +- include/tclap/SwitchArg.h | 2 +- include/tclap/UnlabeledMultiArg.h | 2 +- include/tclap/UnlabeledValueArg.h | 2 +- include/tclap/ValueArg.h | 2 +- include/tclap/ValuesConstraint.h | 2 +- include/tclap/VersionVisitor.h | 2 +- include/tclap/Visitor.h | 2 +- include/tclap/XorHandler.h | 2 +- include/tclap/ZshCompletionOutput.h | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/tclap/Arg.h b/include/tclap/Arg.h index b28eef1..a83e835 100644 --- a/include/tclap/Arg.h +++ b/include/tclap/Arg.h @@ -6,7 +6,7 @@ * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno . - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/ArgException.h b/include/tclap/ArgException.h index 3411aa9..f789d1c 100644 --- a/include/tclap/ArgException.h +++ b/include/tclap/ArgException.h @@ -5,7 +5,7 @@ * file: ArgException.h * * Copyright (c) 2003, Michael E. Smoot . - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/ArgTraits.h b/include/tclap/ArgTraits.h index e894d75..8b11453 100644 --- a/include/tclap/ArgTraits.h +++ b/include/tclap/ArgTraits.h @@ -5,7 +5,7 @@ * file: ArgTraits.h * * Copyright (c) 2007, Daniel Aarno, Michael E. Smoot . - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/CmdLine.h b/include/tclap/CmdLine.h index 0fec8d8..f3452bc 100644 --- a/include/tclap/CmdLine.h +++ b/include/tclap/CmdLine.h @@ -6,7 +6,7 @@ * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/CmdLineInterface.h b/include/tclap/CmdLineInterface.h index 1b25e9b..cf60f34 100644 --- a/include/tclap/CmdLineInterface.h +++ b/include/tclap/CmdLineInterface.h @@ -5,7 +5,7 @@ * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/CmdLineOutput.h b/include/tclap/CmdLineOutput.h index 71ee5a3..11b8939 100644 --- a/include/tclap/CmdLineOutput.h +++ b/include/tclap/CmdLineOutput.h @@ -5,7 +5,7 @@ * file: CmdLineOutput.h * * Copyright (c) 2004, Michael E. Smoot - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/Constraint.h b/include/tclap/Constraint.h index a92acf9..21dc06f 100644 --- a/include/tclap/Constraint.h +++ b/include/tclap/Constraint.h @@ -4,7 +4,7 @@ * file: Constraint.h * * Copyright (c) 2005, Michael E. Smoot - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/DocBookOutput.h b/include/tclap/DocBookOutput.h index f4ac34d..f023824 100644 --- a/include/tclap/DocBookOutput.h +++ b/include/tclap/DocBookOutput.h @@ -5,7 +5,7 @@ * file: DocBookOutput.h * * Copyright (c) 2004, Michael E. Smoot - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/HelpVisitor.h b/include/tclap/HelpVisitor.h index cc3bd07..ee09144 100644 --- a/include/tclap/HelpVisitor.h +++ b/include/tclap/HelpVisitor.h @@ -4,7 +4,7 @@ * file: HelpVisitor.h * * Copyright (c) 2003, Michael E. Smoot . - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/IgnoreRestVisitor.h b/include/tclap/IgnoreRestVisitor.h index e328649..e3e063c 100644 --- a/include/tclap/IgnoreRestVisitor.h +++ b/include/tclap/IgnoreRestVisitor.h @@ -4,7 +4,7 @@ * file: IgnoreRestVisitor.h * * Copyright (c) 2003, Michael E. Smoot . - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/MultiArg.h b/include/tclap/MultiArg.h index 34bb2d7..d478df9 100644 --- a/include/tclap/MultiArg.h +++ b/include/tclap/MultiArg.h @@ -4,7 +4,7 @@ * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/MultiSwitchArg.h b/include/tclap/MultiSwitchArg.h index 8820b64..208d998 100644 --- a/include/tclap/MultiSwitchArg.h +++ b/include/tclap/MultiSwitchArg.h @@ -6,7 +6,7 @@ * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. * Copyright (c) 2005, Michael E. Smoot, Daniel Aarno, Erik Zeek. -* All rights reverved. +* All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/OptionalUnlabeledTracker.h b/include/tclap/OptionalUnlabeledTracker.h index 8174c5f..92f8929 100644 --- a/include/tclap/OptionalUnlabeledTracker.h +++ b/include/tclap/OptionalUnlabeledTracker.h @@ -5,7 +5,7 @@ * file: OptionalUnlabeledTracker.h * * Copyright (c) 2005, Michael E. Smoot . - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/StandardTraits.h b/include/tclap/StandardTraits.h index 46d7f6f..75c9c64 100644 --- a/include/tclap/StandardTraits.h +++ b/include/tclap/StandardTraits.h @@ -5,7 +5,7 @@ * file: StandardTraits.h * * Copyright (c) 2007, Daniel Aarno, Michael E. Smoot . - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/StdOutput.h b/include/tclap/StdOutput.h index 944cff4..f224ea2 100644 --- a/include/tclap/StdOutput.h +++ b/include/tclap/StdOutput.h @@ -5,7 +5,7 @@ * file: StdOutput.h * * Copyright (c) 2004, Michael E. Smoot - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/SwitchArg.h b/include/tclap/SwitchArg.h index 3916109..c2e8395 100644 --- a/include/tclap/SwitchArg.h +++ b/include/tclap/SwitchArg.h @@ -5,7 +5,7 @@ * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/UnlabeledMultiArg.h b/include/tclap/UnlabeledMultiArg.h index d5e1781..0cf15f9 100644 --- a/include/tclap/UnlabeledMultiArg.h +++ b/include/tclap/UnlabeledMultiArg.h @@ -4,7 +4,7 @@ * file: UnlabeledMultiArg.h * * Copyright (c) 2003, Michael E. Smoot. - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/UnlabeledValueArg.h b/include/tclap/UnlabeledValueArg.h index 5721d61..23ab1b9 100644 --- a/include/tclap/UnlabeledValueArg.h +++ b/include/tclap/UnlabeledValueArg.h @@ -5,7 +5,7 @@ * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/ValueArg.h b/include/tclap/ValueArg.h index 7ac2952..2f65e4c 100644 --- a/include/tclap/ValueArg.h +++ b/include/tclap/ValueArg.h @@ -4,7 +4,7 @@ * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/ValuesConstraint.h b/include/tclap/ValuesConstraint.h index cb41f64..91db53c 100644 --- a/include/tclap/ValuesConstraint.h +++ b/include/tclap/ValuesConstraint.h @@ -5,7 +5,7 @@ * file: ValuesConstraint.h * * Copyright (c) 2005, Michael E. Smoot - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/VersionVisitor.h b/include/tclap/VersionVisitor.h index c110d4f..3ece2f4 100644 --- a/include/tclap/VersionVisitor.h +++ b/include/tclap/VersionVisitor.h @@ -5,7 +5,7 @@ * file: VersionVisitor.h * * Copyright (c) 2003, Michael E. Smoot . - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/Visitor.h b/include/tclap/Visitor.h index 38ddcbd..393320a 100644 --- a/include/tclap/Visitor.h +++ b/include/tclap/Visitor.h @@ -4,7 +4,7 @@ * file: Visitor.h * * Copyright (c) 2003, Michael E. Smoot . - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/XorHandler.h b/include/tclap/XorHandler.h index d9dfad3..ec00f2a 100644 --- a/include/tclap/XorHandler.h +++ b/include/tclap/XorHandler.h @@ -5,7 +5,7 @@ * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. diff --git a/include/tclap/ZshCompletionOutput.h b/include/tclap/ZshCompletionOutput.h index 0b37fc7..83eca67 100644 --- a/include/tclap/ZshCompletionOutput.h +++ b/include/tclap/ZshCompletionOutput.h @@ -5,7 +5,7 @@ * file: ZshCompletionOutput.h * * Copyright (c) 2006, Oliver Kiddle - * All rights reverved. + * All rights reserved. * * See the file COPYING in the top directory of this distribution for * more information. From 5879dff2685d08a71f32aefe247f6fc730df6a61 Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Sat, 2 Sep 2017 17:35:50 +0100 Subject: [PATCH 05/13] Fixed more typos --- include/tclap/Arg.h | 6 +++--- include/tclap/ArgTraits.h | 2 +- include/tclap/CmdLine.h | 2 +- include/tclap/IgnoreRestVisitor.h | 2 +- include/tclap/UnlabeledMultiArg.h | 4 ++-- include/tclap/UnlabeledValueArg.h | 16 ++++++++-------- include/tclap/VersionVisitor.h | 2 +- include/tclap/XorHandler.h | 2 +- include/tclap/ZshCompletionOutput.h | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/tclap/Arg.h b/include/tclap/Arg.h index a83e835..14a5be6 100644 --- a/include/tclap/Arg.h +++ b/include/tclap/Arg.h @@ -98,7 +98,7 @@ class Arg std::string _flag; /** - * A single work namd indentifying the argument. + * A single word namd identifying the argument. * This value (preceded by two dashed {--}) can also be used * to identify an argument on the command line. Note that the * _name does NOT include the two dashes as part of the _name. The @@ -137,7 +137,7 @@ class Arg bool _alreadySet; /** - * A pointer to a vistitor object. + * A pointer to a visitor object. * The visitor allows special handling to occur as soon as the * argument is matched. This defaults to NULL and should not * be used unless absolutely necessary. @@ -158,7 +158,7 @@ class Arg bool _acceptsMultipleValues; /** - * Performs the special handling described by the Vistitor. + * Performs the special handling described by the Visitor. */ void _checkWithVisitor() const; diff --git a/include/tclap/ArgTraits.h b/include/tclap/ArgTraits.h index 8b11453..7ae85a9 100644 --- a/include/tclap/ArgTraits.h +++ b/include/tclap/ArgTraits.h @@ -42,7 +42,7 @@ struct ValueLike { /** * A string like argument value type is a value that can be set using - * operator=(string). Usefull if the value type contains spaces which + * operator=(string). Useful if the value type contains spaces which * will be broken up into individual tokens by operator>>. */ struct StringLike { diff --git a/include/tclap/CmdLine.h b/include/tclap/CmdLine.h index f3452bc..c91e656 100644 --- a/include/tclap/CmdLine.h +++ b/include/tclap/CmdLine.h @@ -119,7 +119,7 @@ class CmdLine : public CmdLineInterface /** * A list of Visitors to be explicitly deleted when the destructor - * is called. At the moment, these are the Vistors created for the + * is called. At the moment, these are the Visitors created for the * default Args. */ std::list _visitorDeleteOnExitList; diff --git a/include/tclap/IgnoreRestVisitor.h b/include/tclap/IgnoreRestVisitor.h index e3e063c..d20f6e0 100644 --- a/include/tclap/IgnoreRestVisitor.h +++ b/include/tclap/IgnoreRestVisitor.h @@ -29,7 +29,7 @@ namespace TCLAP { /** - * A Vistor that tells the CmdLine to begin ignoring arguments after + * A Visitor that tells the CmdLine to begin ignoring arguments after * this one is parsed. */ class IgnoreRestVisitor: public Visitor diff --git a/include/tclap/UnlabeledMultiArg.h b/include/tclap/UnlabeledMultiArg.h index 0cf15f9..7995bc2 100644 --- a/include/tclap/UnlabeledMultiArg.h +++ b/include/tclap/UnlabeledMultiArg.h @@ -41,7 +41,7 @@ class UnlabeledMultiArg : public MultiArg { // If compiler has two stage name lookup (as gcc >= 3.4 does) - // this is requried to prevent undef. symbols + // this is required to prevent undef. symbols using MultiArg::_ignoreable; using MultiArg::_hasBlanks; using MultiArg::_extractValue; @@ -171,7 +171,7 @@ class UnlabeledMultiArg : public MultiArg virtual std::string longID(const std::string& val="val") const; /** - * Opertor ==. + * Operator ==. * \param a - The Arg to be compared to this. */ virtual bool operator==(const Arg& a) const; diff --git a/include/tclap/UnlabeledValueArg.h b/include/tclap/UnlabeledValueArg.h index 23ab1b9..25e85ff 100644 --- a/include/tclap/UnlabeledValueArg.h +++ b/include/tclap/UnlabeledValueArg.h @@ -44,7 +44,7 @@ class UnlabeledValueArg : public ValueArg { // If compiler has two stage name lookup (as gcc >= 3.4 does) - // this is requried to prevent undef. symbols + // this is required to prevent undef. symbols using ValueArg::_ignoreable; using ValueArg::_hasBlanks; using ValueArg::_extractValue; @@ -74,7 +74,7 @@ class UnlabeledValueArg : public ValueArg * ignored if the '--' flag is set. This defaults to false (cannot * be ignored) and should generally stay that way unless you have * some special need for certain arguments to be ignored. - * \param v - Optional Vistor. You should leave this blank unless + * \param v - Optional Visitor. You should leave this blank unless * you have a very good reason. */ UnlabeledValueArg( const std::string& name, @@ -104,7 +104,7 @@ class UnlabeledValueArg : public ValueArg * ignored if the '--' flag is set. This defaults to false (cannot * be ignored) and should generally stay that way unless you have * some special need for certain arguments to be ignored. - * \param v - Optional Vistor. You should leave this blank unless + * \param v - Optional Visitor. You should leave this blank unless * you have a very good reason. */ UnlabeledValueArg( const std::string& name, @@ -132,7 +132,7 @@ class UnlabeledValueArg : public ValueArg * ignored if the '--' flag is set. This defaults to false (cannot * be ignored) and should generally stay that way unless you have * some special need for certain arguments to be ignored. - * \param v - Optional Vistor. You should leave this blank unless + * \param v - Optional Visitor. You should leave this blank unless * you have a very good reason. */ UnlabeledValueArg( const std::string& name, @@ -161,7 +161,7 @@ class UnlabeledValueArg : public ValueArg * ignored if the '--' flag is set. This defaults to false (cannot * be ignored) and should generally stay that way unless you have * some special need for certain arguments to be ignored. - * \param v - Optional Vistor. You should leave this blank unless + * \param v - Optional Visitor. You should leave this blank unless * you have a very good reason. */ UnlabeledValueArg( const std::string& name, @@ -177,7 +177,7 @@ class UnlabeledValueArg : public ValueArg * Handles the processing of the argument. * This re-implements the Arg version of this method to set the * _value of the argument appropriately. Handling specific to - * unlabled arguments. + * unlabeled arguments. * \param i - Pointer the the current argument in the list. * \param args - Mutable list of strings. */ @@ -207,7 +207,7 @@ class UnlabeledValueArg : public ValueArg }; /** - * Constructor implemenation. + * Constructor implementation. */ template UnlabeledValueArg::UnlabeledValueArg(const std::string& name, @@ -242,7 +242,7 @@ UnlabeledValueArg::UnlabeledValueArg(const std::string& name, } /** - * Constructor implemenation. + * Constructor implementation. */ template UnlabeledValueArg::UnlabeledValueArg(const std::string& name, diff --git a/include/tclap/VersionVisitor.h b/include/tclap/VersionVisitor.h index 3ece2f4..3ef8b58 100644 --- a/include/tclap/VersionVisitor.h +++ b/include/tclap/VersionVisitor.h @@ -31,7 +31,7 @@ namespace TCLAP { /** - * A Vistor that will call the version method of the given CmdLineOutput + * A Visitor that will call the version method of the given CmdLineOutput * for the specified CmdLine object and then exit. */ class VersionVisitor: public Visitor diff --git a/include/tclap/XorHandler.h b/include/tclap/XorHandler.h index ec00f2a..64fcffc 100644 --- a/include/tclap/XorHandler.h +++ b/include/tclap/XorHandler.h @@ -52,7 +52,7 @@ class XorHandler XorHandler( ) : _orList(std::vector< std::vector >()) {} /** - * Add a list of Arg*'s that will be orred together. + * Add a list of Arg*'s that will be xor'd together. * \param ors - list of Arg* that will be xor'd. */ void add( std::vector& ors ); diff --git a/include/tclap/ZshCompletionOutput.h b/include/tclap/ZshCompletionOutput.h index 83eca67..d3f20f5 100644 --- a/include/tclap/ZshCompletionOutput.h +++ b/include/tclap/ZshCompletionOutput.h @@ -193,7 +193,7 @@ inline void ZshCompletionOutput::printOption(Arg* a, std::string mutex) std::string name = a->nameStartString() + a->getName(); std::string desc = a->getDescription(); - // remove full stop and capitalisation from description as + // remove full stop and capitalization from description as // this is the convention for zsh function if (!desc.compare(0, 12, "(required) ")) { From 68fb0f35a298aea775bef33cf0be87b5ebe1e176 Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Tue, 26 Dec 2017 14:03:13 +0100 Subject: [PATCH 06/13] Quick fix for ZshCompletionOutput test The test was failing because elipsis changed from "..." to "... ". This is a quick and dirty fix and should be cleaned up. Also updated copyright notice # Conflicts: # tests/test85.out # tests/test85.sh --- COPYING | 2 ++ include/tclap/ZshCompletionOutput.h | 6 ++++++ tests/runtests.sh | 0 3 files changed, 8 insertions(+) mode change 100644 => 100755 tests/runtests.sh diff --git a/COPYING b/COPYING index 987be0c..d573236 100644 --- a/COPYING +++ b/COPYING @@ -1,6 +1,8 @@ Copyright (c) 2003 Michael E. Smoot +Copyright (c) 2004 Daniel Aarno +Copyright (c) 2017 Google Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/include/tclap/ZshCompletionOutput.h b/include/tclap/ZshCompletionOutput.h index d3f20f5..d2ce148 100644 --- a/include/tclap/ZshCompletionOutput.h +++ b/include/tclap/ZshCompletionOutput.h @@ -231,6 +231,12 @@ 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(" ... "); + if (pos != std::string::npos) { + arg.erase(pos); + } + arg.erase(0, arg.find_last_of(theDelimiter) + 1); if ( arg.at(arg.length()-1) == ']' ) arg.erase(arg.length()-1); diff --git a/tests/runtests.sh b/tests/runtests.sh old mode 100644 new mode 100755 From 75f440bcac1276c847f5351e14216f6e91def44d Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Tue, 26 Dec 2017 14:03:31 +0100 Subject: [PATCH 07/13] Bump version to 1.2.2 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 66b3dab..1e9f147 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ AC_INIT(Makefile.am) #AC_PREREQ(2.50) AC_CONFIG_AUX_DIR(config) AM_CONFIG_HEADER(config/config.h) -AM_INIT_AUTOMAKE(tclap,1.2.1) +AM_INIT_AUTOMAKE(tclap,1.2.2) AC_PROG_CXX AC_CXX_HAVE_SSTREAM AC_CXX_HAVE_STRSTREAM From 6d80988c3793d30bb8f4e3b21206af113ebba845 Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Tue, 26 Dec 2017 14:25:54 +0100 Subject: [PATCH 08/13] Update changelog with new 1.2.2 release info --- ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index f117f71..7d2a8cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2017-12-26 14:30 macbishop + * Bugfix release for 1.2 branch (v1.2.2): + - Fixed a few typos + - Fixed ZshCompletionOutput + - Fixed brief output with TCLAP_NAMESTRING defined + - Initialize theDelimiter (supress warning) in DocBookOutput + - Fixed } outside of include guards in ArgTraits.h + 2011-04-10 17:08 mes5k * include/tclap/Arg.h: patch that allows arg start strings to be From 8bc3652fe2db6a78ba68f1634cfcd763a4f201d2 Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Tue, 26 Dec 2017 15:11:09 +0100 Subject: [PATCH 09/13] Fix make distcheck issue with stale files in build dir. --- docs/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 8315b36..6cb7c3a 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -19,7 +19,7 @@ install-data-local : cp -R $(abs_srcdir)/html $(DESTDIR)$(docdir) uninstall-local : - chmod -R +w $(DESTDIR)$(docdir) + chmod -R o+w $(DESTDIR)$(docdir) rm -rf $(DESTDIR)$(docdir) dist-hook : @@ -27,5 +27,6 @@ dist-hook : cp -R $(abs_srcdir)/html $(distdir) clean-local: - $(RM) -rf $(abs_srcdir)/html/* + $(RM) -rf $(abs_builddir)/html/* + $(RM) -rf $(abs_builddir)/doxygen_sqlite3.db From fb0d5f1f3e16572a0ed65d7d4996929a4b73c423 Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Tue, 26 Dec 2017 15:18:54 +0100 Subject: [PATCH 10/13] Updated NEWS with new release --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 7f2f787..7dbed98 100644 --- a/NEWS +++ b/NEWS @@ -93,3 +93,5 @@ at test11.cpp and test12.cpp for examples on using ArgTraits for extending tclap for different types. 4/16/11 - Another long break! Several minor bug and memory leak fixes. + +12/26/17 - v1.2 bug fix release \ No newline at end of file From 6c2ef7d6ef85c9fe8efe319df9ff2faa0e142cc3 Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Sat, 23 Dec 2017 16:54:34 +0100 Subject: [PATCH 11/13] Fix sstream/strstream (and config.h) compiler issues. Code would not compile with HAVE_STRSTREAM defined. Code would not compile without HAVE_CONFIG_H defined (unless -DHAVE_STRSTREAM or -DHAVE_SSTREAM was specified). Code would not compile with HAVE_CONFIG_H defined if config.h did not also define HAVE_SSTREAM. This patch moves annoying logic for sstream/strstream logic to it's own file and fixes the above mentioned issues. https://sourceforge.net/p/tclap/bugs/23/ --- include/tclap/Arg.h | 7 ++-- include/tclap/Makefile.am | 4 +-- include/tclap/ValuesConstraint.h | 19 +++-------- include/tclap/ZshCompletionOutput.h | 8 ++++- include/tclap/sstream.h | 50 +++++++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 20 deletions(-) create mode 100644 include/tclap/sstream.h diff --git a/include/tclap/Arg.h b/include/tclap/Arg.h index 14a5be6..3ad3e77 100644 --- a/include/tclap/Arg.h +++ b/include/tclap/Arg.h @@ -6,6 +6,7 @@ * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno . + * Copyright (c) 2017 Google Inc. * All rights reserved. * * See the file COPYING in the top directory of this distribution for @@ -27,8 +28,6 @@ #ifdef HAVE_CONFIG_H #include -#else -#define HAVE_SSTREAM #endif #include @@ -38,6 +37,8 @@ #include #include +#include + #if defined(HAVE_SSTREAM) #include typedef std::istringstream istringstream; @@ -415,7 +416,7 @@ template void ExtractValue(T &destVal, const std::string& strVal, ValueLike vl) { static_cast(vl); // Avoid warning about unused vl - std::istringstream is(strVal); + istringstream is(strVal.c_str()); int valuesRead = 0; while ( is.good() ) { diff --git a/include/tclap/Makefile.am b/include/tclap/Makefile.am index 0e247bf..c475d15 100644 --- a/include/tclap/Makefile.am +++ b/include/tclap/Makefile.am @@ -24,5 +24,5 @@ libtclapinclude_HEADERS = \ Constraint.h \ ValuesConstraint.h \ ArgTraits.h \ - StandardTraits.h - + StandardTraits.h \ + sstream.h diff --git a/include/tclap/ValuesConstraint.h b/include/tclap/ValuesConstraint.h index 91db53c..d1c1df7 100644 --- a/include/tclap/ValuesConstraint.h +++ b/include/tclap/ValuesConstraint.h @@ -23,23 +23,14 @@ #ifndef TCLAP_VALUESCONSTRAINT_H #define TCLAP_VALUESCONSTRAINT_H +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include - -#ifdef HAVE_CONFIG_H -#include -#else -#define HAVE_SSTREAM -#endif - -#if defined(HAVE_SSTREAM) -#include -#elif defined(HAVE_STRSTREAM) -#include -#else -#error "Need a stringstream (sstream or strstream) to compile!" -#endif +#include namespace TCLAP { diff --git a/include/tclap/ZshCompletionOutput.h b/include/tclap/ZshCompletionOutput.h index d2ce148..acf655b 100644 --- a/include/tclap/ZshCompletionOutput.h +++ b/include/tclap/ZshCompletionOutput.h @@ -5,6 +5,7 @@ * file: ZshCompletionOutput.h * * Copyright (c) 2006, Oliver Kiddle + * Copyright (c) 2017 Google Inc. * All rights reserved. * * See the file COPYING in the top directory of this distribution for @@ -23,6 +24,10 @@ #ifndef TCLAP_ZSHCOMPLETIONOUTPUT_H #define TCLAP_ZSHCOMPLETIONOUTPUT_H +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -33,6 +38,7 @@ #include #include #include +#include namespace TCLAP { @@ -284,7 +290,7 @@ inline std::string ZshCompletionOutput::getMutexList( CmdLineInterface& _cmd, Ar return "(-)"; } - std::ostringstream list; + ostringstream list; if ( a->acceptsMultipleValues() ) { list << '*'; diff --git a/include/tclap/sstream.h b/include/tclap/sstream.h new file mode 100644 index 0000000..0118b76 --- /dev/null +++ b/include/tclap/sstream.h @@ -0,0 +1,50 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + +/****************************************************************************** + * + * file: sstream.h + * + * Copyright (c) 2003, Michael E. Smoot . + * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno . + * Copyright (c) 2017 Google Inc. + * All rights reserved. + * + * See the file COPYING in the top directory of this distribution for + * more information. + * + * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + *****************************************************************************/ + +#ifndef TCLAP_SSTREAM_H +#define TCLAP_SSTREAM_H + +#if !defined(HAVE_STRSTREAM) +// Assume sstream is available if strstream is not specified +// (https://sourceforge.net/p/tclap/bugs/23/) +#define HAVE_SSTREAM +#endif + +#if defined(HAVE_SSTREAM) +#include +namespace TCLAP { + typedef std::istringstream istringstream; + typedef std::ostringstream ostringstream; +} +#elif defined(HAVE_STRSTREAM) +#include +namespace TCLAP { + typedef std::istrstream istringstream; + typedef std::ostrstream ostringstream; +} +#else +#error "Need a stringstream (sstream or strstream) to compile!" +#endif + +#endif // TCLAP_SSTREAM_H From 8dab34491d9f08888ad54a9531044c30c95b506d Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Tue, 26 Dec 2017 15:30:31 +0100 Subject: [PATCH 12/13] Update changelog with sstream fixes --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7d2a8cc..7a40715 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ - Fixed ZshCompletionOutput - Fixed brief output with TCLAP_NAMESTRING defined - Initialize theDelimiter (supress warning) in DocBookOutput + - Fixed an issue with config.h and compiling on systems + without sstream.h - Fixed } outside of include guards in ArgTraits.h 2011-04-10 17:08 mes5k From ec3ddcfe41b0544a4551a57439b6b3682fe31479 Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Sat, 23 Dec 2017 16:50:07 +0100 Subject: [PATCH 13/13] IWYU: sstream Explicitly include sstream in tets wherever it is used. --- examples/test11.cpp | 2 ++ examples/test12.cpp | 2 ++ examples/test14.cpp | 2 ++ examples/test15.cpp | 2 ++ examples/test16.cpp | 2 ++ 5 files changed, 10 insertions(+) diff --git a/examples/test11.cpp b/examples/test11.cpp index f7d06fe..71ae4ac 100644 --- a/examples/test11.cpp +++ b/examples/test11.cpp @@ -1,6 +1,8 @@ #include "tclap/CmdLine.h" #include +#include + using namespace TCLAP; // Define a simple 3D vector type diff --git a/examples/test12.cpp b/examples/test12.cpp index 21016ea..20447a7 100644 --- a/examples/test12.cpp +++ b/examples/test12.cpp @@ -2,6 +2,8 @@ #include #include +#include + using namespace TCLAP; // Define a simple 3D vector type diff --git a/examples/test14.cpp b/examples/test14.cpp index e194845..c33e5c0 100644 --- a/examples/test14.cpp +++ b/examples/test14.cpp @@ -2,6 +2,8 @@ #include #include +#include + // Define a simple 3D vector type template struct Vect : public TCLAP::StringLikeTrait { diff --git a/examples/test15.cpp b/examples/test15.cpp index 62cd95b..ec9dc11 100644 --- a/examples/test15.cpp +++ b/examples/test15.cpp @@ -2,6 +2,8 @@ #include #include +#include + // Define a simple 3D vector type template struct Vect { diff --git a/examples/test16.cpp b/examples/test16.cpp index fae185c..d0c9dab 100644 --- a/examples/test16.cpp +++ b/examples/test16.cpp @@ -2,6 +2,8 @@ #include #include +#include + namespace TCLAP { template<> struct ArgTraits< std::vector > {