From 16a85850a9cbfb277212c9b9f64bb95e74e75058 Mon Sep 17 00:00:00 2001 From: Carbo Kuo Date: Fri, 26 Jul 2024 16:59:34 -0400 Subject: [PATCH] Update the bundled tclap to 1.2.5. --- deps/tclap-1.2.2/tclap/StandardTraits.h | 208 ------- deps/tclap-1.2.2/tclap/SwitchArg.h | 266 -------- deps/tclap-1.2.2/tclap/ValueArg.h | 425 ------------- deps/tclap-1.2.5/Makefile.am | 1 + deps/tclap-1.2.5/Makefile.in | 588 ++++++++++++++++++ deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/Arg.h | 16 +- .../tclap/ArgException.h | 13 + .../tclap/ArgTraits.h | 44 +- .../tclap/CmdLine.h | 34 +- .../tclap/CmdLineInterface.h | 5 +- .../tclap/CmdLineOutput.h | 3 + .../tclap/Constraint.h | 10 + .../tclap/DocBookOutput.h | 7 +- .../tclap/HelpVisitor.h | 2 + .../tclap/IgnoreRestVisitor.h | 2 + deps/tclap-1.2.5/tclap/Makefile.am | 29 + deps/tclap-1.2.5/tclap/Makefile.in | 556 +++++++++++++++++ .../tclap/MultiArg.h | 18 +- .../tclap/MultiSwitchArg.h | 9 +- .../tclap/OptionalUnlabeledTracker.h | 2 + deps/tclap-1.2.5/tclap/StandardTraits.h | 63 ++ .../tclap/StdOutput.h | 1 + deps/tclap-1.2.5/tclap/SwitchArg.h | 273 ++++++++ .../tclap/UnlabeledMultiArg.h | 3 + .../tclap/UnlabeledValueArg.h | 3 + deps/tclap-1.2.5/tclap/ValueArg.h | 430 +++++++++++++ .../tclap/ValuesConstraint.h | 15 +- .../tclap/VersionVisitor.h | 0 .../tclap/Visitor.h | 8 +- .../tclap/XorHandler.h | 14 +- .../tclap/ZshCompletionOutput.h | 5 +- .../tclap/sstream.h | 0 src/CMakeLists.txt | 2 +- 33 files changed, 2096 insertions(+), 959 deletions(-) delete mode 100644 deps/tclap-1.2.2/tclap/StandardTraits.h delete mode 100644 deps/tclap-1.2.2/tclap/SwitchArg.h delete mode 100644 deps/tclap-1.2.2/tclap/ValueArg.h create mode 100644 deps/tclap-1.2.5/Makefile.am create mode 100644 deps/tclap-1.2.5/Makefile.in rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/Arg.h (97%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/ArgException.h (90%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/ArgTraits.h (63%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/CmdLine.h (93%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/CmdLineInterface.h (95%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/CmdLineOutput.h (95%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/Constraint.h (85%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/DocBookOutput.h (98%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/HelpVisitor.h (97%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/IgnoreRestVisitor.h (95%) create mode 100644 deps/tclap-1.2.5/tclap/Makefile.am create mode 100644 deps/tclap-1.2.5/tclap/Makefile.in rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/MultiArg.h (96%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/MultiSwitchArg.h (97%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/OptionalUnlabeledTracker.h (96%) create mode 100644 deps/tclap-1.2.5/tclap/StandardTraits.h rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/StdOutput.h (99%) create mode 100644 deps/tclap-1.2.5/tclap/SwitchArg.h rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/UnlabeledMultiArg.h (99%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/UnlabeledValueArg.h (99%) create mode 100644 deps/tclap-1.2.5/tclap/ValueArg.h rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/ValuesConstraint.h (91%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/VersionVisitor.h (100%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/Visitor.h (84%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/XorHandler.h (93%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/ZshCompletionOutput.h (98%) rename deps/{tclap-1.2.2 => tclap-1.2.5}/tclap/sstream.h (100%) diff --git a/deps/tclap-1.2.2/tclap/StandardTraits.h b/deps/tclap-1.2.2/tclap/StandardTraits.h deleted file mode 100644 index 75c9c64b5..000000000 --- a/deps/tclap-1.2.2/tclap/StandardTraits.h +++ /dev/null @@ -1,208 +0,0 @@ -// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- - -/****************************************************************************** - * - * file: StandardTraits.h - * - * Copyright (c) 2007, Daniel Aarno, Michael E. Smoot . - * 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. - * - *****************************************************************************/ - -// This is an internal tclap file, you should probably not have to -// include this directly - -#ifndef TCLAP_STANDARD_TRAITS_H -#define TCLAP_STANDARD_TRAITS_H - -#ifdef HAVE_CONFIG_H -#include // To check for long long -#endif - -// If Microsoft has already typedef'd wchar_t as an unsigned -// short, then compiles will break because it's as if we're -// creating ArgTraits twice for unsigned short. Thus... -#ifdef _MSC_VER -#ifndef _NATIVE_WCHAR_T_DEFINED -#define TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS -#endif -#endif - -namespace TCLAP { - -// ====================================================================== -// Integer types -// ====================================================================== - -/** - * longs have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; - -/** - * ints have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; - -/** - * shorts have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; - -/** - * chars have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; - -#ifdef HAVE_LONG_LONG -/** - * long longs have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; -#endif - -// ====================================================================== -// Unsigned integer types -// ====================================================================== - -/** - * unsigned longs have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; - -/** - * unsigned ints have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; - -/** - * unsigned shorts have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; - -/** - * unsigned chars have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; - -// Microsoft implements size_t awkwardly. -#if defined(_MSC_VER) && defined(_M_X64) -/** - * size_ts have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; -#endif - - -#ifdef HAVE_LONG_LONG -/** - * unsigned long longs have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; -#endif - -// ====================================================================== -// Float types -// ====================================================================== - -/** - * floats have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; - -/** - * doubles have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; - -// ====================================================================== -// Other types -// ====================================================================== - -/** - * bools have value-like semantics. - */ -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; - - -/** - * wchar_ts have value-like semantics. - */ -#ifndef TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS -template<> -struct ArgTraits { - typedef ValueLike ValueCategory; -}; -#endif - -/** - * Strings have string like argument traits. - */ -template<> -struct ArgTraits { - typedef StringLike ValueCategory; -}; - -template -void SetString(T &dst, const std::string &src) -{ - dst = src; -} - -} // namespace - -#endif - diff --git a/deps/tclap-1.2.2/tclap/SwitchArg.h b/deps/tclap-1.2.2/tclap/SwitchArg.h deleted file mode 100644 index c2e83957a..000000000 --- a/deps/tclap-1.2.2/tclap/SwitchArg.h +++ /dev/null @@ -1,266 +0,0 @@ - -/****************************************************************************** - * - * file: SwitchArg.h - * - * Copyright (c) 2003, Michael E. Smoot . - * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. - * 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_SWITCH_ARG_H -#define TCLAP_SWITCH_ARG_H - -#include -#include - -#include - -namespace TCLAP { - -/** - * A simple switch argument. If the switch is set on the command line, then - * the getValue method will return the opposite of the default value for the - * switch. - */ -class SwitchArg : public Arg -{ - protected: - - /** - * The value of the switch. - */ - bool _value; - - /** - * Used to support the reset() method so that ValueArg can be - * reset to their constructed value. - */ - bool _default; - - public: - - /** - * SwitchArg constructor. - * \param flag - The one character flag that identifies this - * argument on the command line. - * \param name - A one word name for the argument. Can be - * used as a long flag on the command line. - * \param desc - A description of what the argument is for or - * does. - * \param def - The default value for this Switch. - * \param v - An optional visitor. You probably should not - * use this unless you have a very good reason. - */ - SwitchArg(const std::string& flag, - const std::string& name, - const std::string& desc, - bool def = false, - Visitor* v = NULL); - - - /** - * SwitchArg constructor. - * \param flag - The one character flag that identifies this - * argument on the command line. - * \param name - A one word name for the argument. Can be - * used as a long flag on the command line. - * \param desc - A description of what the argument is for or - * does. - * \param parser - A CmdLine parser object to add this Arg to - * \param def - The default value for this Switch. - * \param v - An optional visitor. You probably should not - * use this unless you have a very good reason. - */ - SwitchArg(const std::string& flag, - const std::string& name, - const std::string& desc, - CmdLineInterface& parser, - bool def = false, - Visitor* v = NULL); - - - /** - * Handles the processing of the argument. - * This re-implements the Arg version of this method to set the - * _value of the argument appropriately. - * \param i - Pointer the the current argument in the list. - * \param args - Mutable list of strings. Passed - * in from main(). - */ - virtual bool processArg(int* i, std::vector& args); - - /** - * Checks a string to see if any of the chars in the string - * match the flag for this Switch. - */ - bool combinedSwitchesMatch(std::string& combined); - - /** - * Returns bool, whether or not the switch has been set. - */ - bool getValue(); - - virtual void reset(); - - private: - /** - * Checks to see if we've found the last match in - * a combined string. - */ - bool lastCombined(std::string& combined); - - /** - * Does the common processing of processArg. - */ - void commonProcessing(); -}; - -////////////////////////////////////////////////////////////////////// -//BEGIN SwitchArg.cpp -////////////////////////////////////////////////////////////////////// -inline SwitchArg::SwitchArg(const std::string& flag, - const std::string& name, - const std::string& desc, - bool default_val, - Visitor* v ) -: Arg(flag, name, desc, false, false, v), - _value( default_val ), - _default( default_val ) -{ } - -inline SwitchArg::SwitchArg(const std::string& flag, - const std::string& name, - const std::string& desc, - CmdLineInterface& parser, - bool default_val, - Visitor* v ) -: Arg(flag, name, desc, false, false, v), - _value( default_val ), - _default(default_val) -{ - parser.add( this ); -} - -inline bool SwitchArg::getValue() { return _value; } - -inline bool SwitchArg::lastCombined(std::string& combinedSwitches ) -{ - for ( unsigned int i = 1; i < combinedSwitches.length(); i++ ) - if ( combinedSwitches[i] != Arg::blankChar() ) - return false; - - return true; -} - -inline bool SwitchArg::combinedSwitchesMatch(std::string& combinedSwitches ) -{ - // make sure this is actually a combined switch - if ( combinedSwitches.length() > 0 && - combinedSwitches[0] != Arg::flagStartString()[0] ) - return false; - - // make sure it isn't a long name - if ( combinedSwitches.substr( 0, Arg::nameStartString().length() ) == - Arg::nameStartString() ) - return false; - - // make sure the delimiter isn't in the string - if ( combinedSwitches.find_first_of( Arg::delimiter() ) != std::string::npos ) - return false; - - // ok, we're not specifying a ValueArg, so we know that we have - // a combined switch list. - for ( unsigned int i = 1; i < combinedSwitches.length(); i++ ) - if ( _flag.length() > 0 && - combinedSwitches[i] == _flag[0] && - _flag[0] != Arg::flagStartString()[0] ) - { - // update the combined switches so this one is no longer present - // this is necessary so that no unlabeled args are matched - // later in the processing. - //combinedSwitches.erase(i,1); - combinedSwitches[i] = Arg::blankChar(); - return true; - } - - // none of the switches passed in the list match. - return false; -} - -inline void SwitchArg::commonProcessing() -{ - if ( _xorSet ) - throw(CmdLineParseException( - "Mutually exclusive argument already set!", toString())); - - if ( _alreadySet ) - throw(CmdLineParseException("Argument already set!", toString())); - - _alreadySet = true; - - if ( _value == true ) - _value = false; - else - _value = true; - - _checkWithVisitor(); -} - -inline bool SwitchArg::processArg(int *i, std::vector& args) -{ - if ( _ignoreable && Arg::ignoreRest() ) - return false; - - // if the whole string matches the flag or name string - if ( argMatches( args[*i] ) ) - { - commonProcessing(); - - return true; - } - // if a substring matches the flag as part of a combination - else if ( combinedSwitchesMatch( args[*i] ) ) - { - // check again to ensure we don't misinterpret - // this as a MultiSwitchArg - if ( combinedSwitchesMatch( args[*i] ) ) - throw(CmdLineParseException("Argument already set!", - toString())); - - commonProcessing(); - - // We only want to return true if we've found the last combined - // match in the string, otherwise we return true so that other - // switches in the combination will have a chance to match. - return lastCombined( args[*i] ); - } - else - return false; -} - -inline void SwitchArg::reset() -{ - Arg::reset(); - _value = _default; -} -////////////////////////////////////////////////////////////////////// -//End SwitchArg.cpp -////////////////////////////////////////////////////////////////////// - -} //namespace TCLAP - -#endif diff --git a/deps/tclap-1.2.2/tclap/ValueArg.h b/deps/tclap-1.2.2/tclap/ValueArg.h deleted file mode 100644 index 2f65e4c98..000000000 --- a/deps/tclap-1.2.2/tclap/ValueArg.h +++ /dev/null @@ -1,425 +0,0 @@ -/****************************************************************************** - * - * file: ValueArg.h - * - * Copyright (c) 2003, Michael E. Smoot . - * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. - * 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_VALUE_ARGUMENT_H -#define TCLAP_VALUE_ARGUMENT_H - -#include -#include - -#include -#include - -namespace TCLAP { - -/** - * The basic labeled argument that parses a value. - * This is a template class, which means the type T defines the type - * that a given object will attempt to parse when the flag/name is matched - * on the command line. While there is nothing stopping you from creating - * an unflagged ValueArg, it is unwise and would cause significant problems. - * Instead use an UnlabeledValueArg. - */ -template -class ValueArg : public Arg -{ - protected: - - /** - * The value parsed from the command line. - * Can be of any type, as long as the >> operator for the type - * is defined. - */ - T _value; - - /** - * Used to support the reset() method so that ValueArg can be - * reset to their constructed value. - */ - T _default; - - /** - * A human readable description of the type to be parsed. - * This is a hack, plain and simple. Ideally we would use RTTI to - * return the name of type T, but until there is some sort of - * consistent support for human readable names, we are left to our - * own devices. - */ - std::string _typeDesc; - - /** - * A Constraint this Arg must conform to. - */ - Constraint* _constraint; - - /** - * Extracts the value from the string. - * Attempts to parse string as type T, if this fails an exception - * is thrown. - * \param val - value to be parsed. - */ - void _extractValue( const std::string& val ); - - public: - - /** - * Labeled ValueArg constructor. - * You could conceivably call this constructor with a blank flag, - * but that would make you a bad person. It would also cause - * an exception to be thrown. If you want an unlabeled argument, - * use the other constructor. - * \param flag - The one character flag that identifies this - * argument on the command line. - * \param name - A one word name for the argument. Can be - * used as a long flag on the command line. - * \param desc - A description of what the argument is for or - * does. - * \param req - Whether the argument is required on the command - * line. - * \param value - The default value assigned to this argument if it - * is not present on the command line. - * \param typeDesc - A short, human readable description of the - * type that this object expects. This is used in the generation - * of the USAGE statement. The goal is to be helpful to the end user - * of the program. - * \param v - An optional visitor. You probably should not - * use this unless you have a very good reason. - */ - ValueArg( const std::string& flag, - const std::string& name, - const std::string& desc, - bool req, - T value, - const std::string& typeDesc, - Visitor* v = NULL); - - - /** - * Labeled ValueArg constructor. - * You could conceivably call this constructor with a blank flag, - * but that would make you a bad person. It would also cause - * an exception to be thrown. If you want an unlabeled argument, - * use the other constructor. - * \param flag - The one character flag that identifies this - * argument on the command line. - * \param name - A one word name for the argument. Can be - * used as a long flag on the command line. - * \param desc - A description of what the argument is for or - * does. - * \param req - Whether the argument is required on the command - * line. - * \param value - The default value assigned to this argument if it - * is not present on the command line. - * \param typeDesc - A short, human readable description of the - * type that this object expects. This is used in the generation - * of the USAGE statement. The goal is to be helpful to the end user - * of the program. - * \param parser - A CmdLine parser object to add this Arg to - * \param v - An optional visitor. You probably should not - * use this unless you have a very good reason. - */ - ValueArg( const std::string& flag, - const std::string& name, - const std::string& desc, - bool req, - T value, - const std::string& typeDesc, - CmdLineInterface& parser, - Visitor* v = NULL ); - - /** - * Labeled ValueArg constructor. - * You could conceivably call this constructor with a blank flag, - * but that would make you a bad person. It would also cause - * an exception to be thrown. If you want an unlabeled argument, - * use the other constructor. - * \param flag - The one character flag that identifies this - * argument on the command line. - * \param name - A one word name for the argument. Can be - * used as a long flag on the command line. - * \param desc - A description of what the argument is for or - * does. - * \param req - Whether the argument is required on the command - * line. - * \param value - The default value assigned to this argument if it - * is not present on the command line. - * \param constraint - A pointer to a Constraint object used - * to constrain this Arg. - * \param parser - A CmdLine parser object to add this Arg to. - * \param v - An optional visitor. You probably should not - * use this unless you have a very good reason. - */ - ValueArg( const std::string& flag, - const std::string& name, - const std::string& desc, - bool req, - T value, - Constraint* constraint, - CmdLineInterface& parser, - Visitor* v = NULL ); - - /** - * Labeled ValueArg constructor. - * You could conceivably call this constructor with a blank flag, - * but that would make you a bad person. It would also cause - * an exception to be thrown. If you want an unlabeled argument, - * use the other constructor. - * \param flag - The one character flag that identifies this - * argument on the command line. - * \param name - A one word name for the argument. Can be - * used as a long flag on the command line. - * \param desc - A description of what the argument is for or - * does. - * \param req - Whether the argument is required on the command - * line. - * \param value - The default value assigned to this argument if it - * is not present on the command line. - * \param constraint - A pointer to a Constraint object used - * to constrain this Arg. - * \param v - An optional visitor. You probably should not - * use this unless you have a very good reason. - */ - ValueArg( const std::string& flag, - const std::string& name, - const std::string& desc, - bool req, - T value, - Constraint* constraint, - Visitor* v = NULL ); - - /** - * Handles the processing of the argument. - * This re-implements the Arg version of this method to set the - * _value of the argument appropriately. It knows the difference - * between labeled and unlabeled. - * \param i - Pointer the the current argument in the list. - * \param args - Mutable list of strings. Passed - * in from main(). - */ - virtual bool processArg(int* i, std::vector& args); - - /** - * Returns the value of the argument. - */ - T& getValue() ; - - /** - * Specialization of shortID. - * \param val - value to be used. - */ - virtual std::string shortID(const std::string& val = "val") const; - - /** - * Specialization of longID. - * \param val - value to be used. - */ - virtual std::string longID(const std::string& val = "val") const; - - virtual void reset() ; - -private: - /** - * Prevent accidental copying - */ - ValueArg(const ValueArg& rhs); - ValueArg& operator=(const ValueArg& rhs); -}; - - -/** - * Constructor implementation. - */ -template -ValueArg::ValueArg(const std::string& flag, - const std::string& name, - const std::string& desc, - bool req, - T val, - const std::string& typeDesc, - Visitor* v) -: Arg(flag, name, desc, req, true, v), - _value( val ), - _default( val ), - _typeDesc( typeDesc ), - _constraint( NULL ) -{ } - -template -ValueArg::ValueArg(const std::string& flag, - const std::string& name, - const std::string& desc, - bool req, - T val, - const std::string& typeDesc, - CmdLineInterface& parser, - Visitor* v) -: Arg(flag, name, desc, req, true, v), - _value( val ), - _default( val ), - _typeDesc( typeDesc ), - _constraint( NULL ) -{ - parser.add( this ); -} - -template -ValueArg::ValueArg(const std::string& flag, - const std::string& name, - const std::string& desc, - bool req, - T val, - Constraint* constraint, - Visitor* v) -: Arg(flag, name, desc, req, true, v), - _value( val ), - _default( val ), - _typeDesc( constraint->shortID() ), - _constraint( constraint ) -{ } - -template -ValueArg::ValueArg(const std::string& flag, - const std::string& name, - const std::string& desc, - bool req, - T val, - Constraint* constraint, - CmdLineInterface& parser, - Visitor* v) -: Arg(flag, name, desc, req, true, v), - _value( val ), - _default( val ), - _typeDesc( constraint->shortID() ), - _constraint( constraint ) -{ - parser.add( this ); -} - - -/** - * Implementation of getValue(). - */ -template -T& ValueArg::getValue() { return _value; } - -/** - * Implementation of processArg(). - */ -template -bool ValueArg::processArg(int *i, std::vector& args) -{ - if ( _ignoreable && Arg::ignoreRest() ) - return false; - - if ( _hasBlanks( args[*i] ) ) - return false; - - std::string flag = args[*i]; - - std::string value = ""; - trimFlag( flag, value ); - - if ( argMatches( flag ) ) - { - if ( _alreadySet ) - { - if ( _xorSet ) - throw( CmdLineParseException( - "Mutually exclusive argument already set!", - toString()) ); - else - throw( CmdLineParseException("Argument already set!", - toString()) ); - } - - if ( Arg::delimiter() != ' ' && value == "" ) - throw( ArgParseException( - "Couldn't find delimiter for this argument!", - toString() ) ); - - if ( value == "" ) - { - (*i)++; - if ( static_cast(*i) < args.size() ) - _extractValue( args[*i] ); - else - throw( ArgParseException("Missing a value for this argument!", - toString() ) ); - } - else - _extractValue( value ); - - _alreadySet = true; - _checkWithVisitor(); - return true; - } - else - return false; -} - -/** - * Implementation of shortID. - */ -template -std::string ValueArg::shortID(const std::string& val) const -{ - static_cast(val); // Ignore input, don't warn - return Arg::shortID( _typeDesc ); -} - -/** - * Implementation of longID. - */ -template -std::string ValueArg::longID(const std::string& val) const -{ - static_cast(val); // Ignore input, don't warn - return Arg::longID( _typeDesc ); -} - -template -void ValueArg::_extractValue( const std::string& val ) -{ - try { - ExtractValue(_value, val, typename ArgTraits::ValueCategory()); - } catch( ArgParseException &e) { - throw ArgParseException(e.error(), toString()); - } - - if ( _constraint != NULL ) - if ( ! _constraint->check( _value ) ) - throw( CmdLineParseException( "Value '" + val + - + "' does not meet constraint: " - + _constraint->description(), - toString() ) ); -} - -template -void ValueArg::reset() -{ - Arg::reset(); - _value = _default; -} - -} // namespace TCLAP - -#endif diff --git a/deps/tclap-1.2.5/Makefile.am b/deps/tclap-1.2.5/Makefile.am new file mode 100644 index 000000000..766f29991 --- /dev/null +++ b/deps/tclap-1.2.5/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = tclap diff --git a/deps/tclap-1.2.5/Makefile.in b/deps/tclap-1.2.5/Makefile.in new file mode 100644 index 000000000..b40e7fadf --- /dev/null +++ b/deps/tclap-1.2.5/Makefile.in @@ -0,0 +1,588 @@ +# Makefile.in generated by automake 1.16.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = include +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/ac_cxx_have_long_long.m4 \ + $(top_srcdir)/config/ac_cxx_have_sstream.m4 \ + $(top_srcdir)/config/ac_cxx_have_strstream.m4 \ + $(top_srcdir)/config/ac_cxx_namespaces.m4 \ + $(top_srcdir)/config/ac_cxx_warn_effective_cxx.m4 \ + $(top_srcdir)/config/bb_enable_doxygen.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir distdir-am +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/config/mkinstalldirs +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOT = @DOT@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARN_EFFECTIVE_CXX = @WARN_EFFECTIVE_CXX@ +WARN_NO_EFFECTIVE_CXX = @WARN_NO_EFFECTIVE_CXX@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = tclap +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-generic distclean-tags distdir dvi dvi-am \ + html html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/deps/tclap-1.2.2/tclap/Arg.h b/deps/tclap-1.2.5/tclap/Arg.h similarity index 97% rename from deps/tclap-1.2.2/tclap/Arg.h rename to deps/tclap-1.2.5/tclap/Arg.h index 3ad3e779f..f8c4a5fc5 100644 --- a/deps/tclap-1.2.2/tclap/Arg.h +++ b/deps/tclap-1.2.5/tclap/Arg.h @@ -39,16 +39,6 @@ #include -#if defined(HAVE_SSTREAM) -#include -typedef std::istringstream istringstream; -#elif defined(HAVE_STRSTREAM) -#include -typedef std::istrstream istringstream; -#else -#error "Need a stringstream (sstream or strstream) to compile!" -#endif - #include #include #include @@ -394,17 +384,17 @@ class Arg /** * Typedef of an Arg list iterator. */ -typedef std::list::iterator ArgListIterator; +typedef std::list::const_iterator ArgListIterator; /** * Typedef of an Arg vector iterator. */ -typedef std::vector::iterator ArgVectorIterator; +typedef std::vector::const_iterator ArgVectorIterator; /** * Typedef of a Visitor list iterator. */ -typedef std::list::iterator VisitorListIterator; +typedef std::list::const_iterator VisitorListIterator; /* * Extract a value of type T from it's string representation contained diff --git a/deps/tclap-1.2.2/tclap/ArgException.h b/deps/tclap-1.2.5/tclap/ArgException.h similarity index 90% rename from deps/tclap-1.2.2/tclap/ArgException.h rename to deps/tclap-1.2.5/tclap/ArgException.h index f789d1cfc..1e0f65919 100644 --- a/deps/tclap-1.2.2/tclap/ArgException.h +++ b/deps/tclap-1.2.5/tclap/ArgException.h @@ -5,6 +5,7 @@ * file: ArgException.h * * Copyright (c) 2003, Michael E. Smoot . + * Copyright (c) 2017 Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for @@ -184,6 +185,18 @@ class SpecificationException : public ArgException }; +/** + * Thrown when TCLAP thinks the program should exit. + * + * For example after parse error this exception will be thrown (and + * normally caught). This allows any resource to be clened properly + * before exit. + * + * If exception handling is disabled (CmdLine::setExceptionHandling), + * this exception will propagate to the call site, allowing the + * program to catch it and avoid program termination, or do it's own + * cleanup. See for example, https://sourceforge.net/p/tclap/bugs/29. + */ class ExitException { public: ExitException(int estat) : _estat(estat) {} diff --git a/deps/tclap-1.2.2/tclap/ArgTraits.h b/deps/tclap-1.2.5/tclap/ArgTraits.h similarity index 63% rename from deps/tclap-1.2.2/tclap/ArgTraits.h rename to deps/tclap-1.2.5/tclap/ArgTraits.h index 7ae85a9e5..0ccf5e36b 100644 --- a/deps/tclap-1.2.2/tclap/ArgTraits.h +++ b/deps/tclap-1.2.5/tclap/ArgTraits.h @@ -5,6 +5,7 @@ * file: ArgTraits.h * * Copyright (c) 2007, Daniel Aarno, Michael E. Smoot . + * Copyright (c) 2017 Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for @@ -73,13 +74,46 @@ struct ValueLikeTrait { * Arg traits are used to get compile type specialization when parsing * argument values. Using an ArgTraits you can specify the way that * values gets assigned to any particular type during parsing. The two - * supported types are StringLike and ValueLike. + * supported types are StringLike and ValueLike. ValueLike is the + * default and means that operator>> will be used to assign values to + * the type. */ template -struct ArgTraits { - typedef typename T::ValueCategory ValueCategory; - virtual ~ArgTraits() {} - //typedef ValueLike ValueCategory; +class ArgTraits { + // This is a bit silly, but what we want to do is: + // 1) If there exists a specialization of ArgTraits for type X, + // use it. + // + // 2) If no specialization exists but X has the typename + // X::ValueCategory, use the specialization for X::ValueCategory. + // + // 3) If neither (1) nor (2) defines the trait, use the default + // which is ValueLike. + + // This is the "how": + // + // test(0) (where 0 is the NULL ptr) will match + // test(typename C::ValueCategory*) iff type T has the + // corresponding typedef. If it does not test(...) will be + // matched. This allows us to determine if T::ValueCategory + // exists by checking the sizeof for the test function (return + // value must have different sizeof). + template static short test(typename C::ValueCategory*); + template static long test(...); + static const bool hasTrait = sizeof(test(0)) == sizeof(short); + + template + struct DefaultArgTrait { + typedef ValueLike ValueCategory; + }; + + template + struct DefaultArgTrait { + typedef typename C::ValueCategory ValueCategory; + }; + +public: + typedef typename DefaultArgTrait::ValueCategory ValueCategory; }; } // namespace diff --git a/deps/tclap-1.2.2/tclap/CmdLine.h b/deps/tclap-1.2.5/tclap/CmdLine.h similarity index 93% rename from deps/tclap-1.2.2/tclap/CmdLine.h rename to deps/tclap-1.2.5/tclap/CmdLine.h index c91e656c8..dc49bae24 100644 --- a/deps/tclap-1.2.2/tclap/CmdLine.h +++ b/deps/tclap-1.2.5/tclap/CmdLine.h @@ -183,6 +183,11 @@ class CmdLine : public CmdLineInterface */ bool _helpAndVersion; + /** + * Whether or not to ignore unmatched args. + */ + bool _ignoreUnmatched; + public: /** @@ -232,7 +237,7 @@ class CmdLine : public CmdLineInterface * add does not need to be called. * \param xors - List of Args to be added and xor'd. */ - void xorAdd( std::vector& xors ); + void xorAdd( const std::vector& xors ); /** * Parses the command line. @@ -313,6 +318,13 @@ class CmdLine : public CmdLineInterface */ void reset(); + /** + * Allows unmatched args to be ignored. By default false. + * + * @param ignore If true the cmdline will ignore any unmatched args + * and if false it will behave as normal. + */ + void ignoreUnmatched(const bool ignore); }; @@ -337,7 +349,8 @@ inline CmdLine::CmdLine(const std::string& m, _output(0), _handleExceptions(true), _userSetOutput(false), - _helpAndVersion(help) + _helpAndVersion(help), + _ignoreUnmatched(false) { _constructor(); } @@ -390,7 +403,7 @@ inline void CmdLine::_constructor() deleteOnExit(v); } -inline void CmdLine::xorAdd( std::vector& ors ) +inline void CmdLine::xorAdd( const std::vector& ors ) { _xorHandler.add( ors ); @@ -445,8 +458,14 @@ inline void CmdLine::parse(std::vector& args) { bool shouldExit = false; int estat = 0; - try { + if (args.empty()) { + // https://sourceforge.net/p/tclap/bugs/30/ + throw CmdLineParseException("The args vector must not be empty, " + "the first entry should contain the " + "program's name."); + } + _progName = args.front(); args.erase(args.begin()); @@ -470,7 +489,7 @@ inline void CmdLine::parse(std::vector& args) if ( !matched && _emptyCombined( args[i] ) ) matched = true; - if ( !matched && !Arg::ignoreRest() ) + if ( !matched && !Arg::ignoreRest() && !_ignoreUnmatched) throw(CmdLineParseException("Couldn't find match " "for argument", args[i])); @@ -623,6 +642,11 @@ inline void CmdLine::reset() _progName.clear(); } +inline void CmdLine::ignoreUnmatched(const bool ignore) +{ + _ignoreUnmatched = ignore; +} + /////////////////////////////////////////////////////////////////////////////// //End CmdLine.cpp /////////////////////////////////////////////////////////////////////////////// diff --git a/deps/tclap-1.2.2/tclap/CmdLineInterface.h b/deps/tclap-1.2.5/tclap/CmdLineInterface.h similarity index 95% rename from deps/tclap-1.2.2/tclap/CmdLineInterface.h rename to deps/tclap-1.2.5/tclap/CmdLineInterface.h index cf60f34c1..a9bdca09b 100644 --- a/deps/tclap-1.2.2/tclap/CmdLineInterface.h +++ b/deps/tclap-1.2.5/tclap/CmdLineInterface.h @@ -1,3 +1,5 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** * @@ -5,6 +7,7 @@ * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. + * Copyright (c) 2017, Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for @@ -75,7 +78,7 @@ class CmdLineInterface * add does not need to be called. * \param xors - List of Args to be added and xor'd. */ - virtual void xorAdd( std::vector& xors )=0; + virtual void xorAdd( const std::vector& xors )=0; /** * Parses the command line. diff --git a/deps/tclap-1.2.2/tclap/CmdLineOutput.h b/deps/tclap-1.2.5/tclap/CmdLineOutput.h similarity index 95% rename from deps/tclap-1.2.2/tclap/CmdLineOutput.h rename to deps/tclap-1.2.5/tclap/CmdLineOutput.h index 11b893908..cbc9a327a 100644 --- a/deps/tclap-1.2.2/tclap/CmdLineOutput.h +++ b/deps/tclap-1.2.5/tclap/CmdLineOutput.h @@ -1,3 +1,5 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** @@ -5,6 +7,7 @@ * file: CmdLineOutput.h * * Copyright (c) 2004, Michael E. Smoot + * Copyright (c) 2017, Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for diff --git a/deps/tclap-1.2.2/tclap/Constraint.h b/deps/tclap-1.2.5/tclap/Constraint.h similarity index 85% rename from deps/tclap-1.2.2/tclap/Constraint.h rename to deps/tclap-1.2.5/tclap/Constraint.h index 21dc06f98..ff869cc78 100644 --- a/deps/tclap-1.2.2/tclap/Constraint.h +++ b/deps/tclap-1.2.5/tclap/Constraint.h @@ -1,9 +1,12 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** * * file: Constraint.h * * Copyright (c) 2005, Michael E. Smoot + * Copyright (c) 2017, Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for @@ -28,6 +31,7 @@ #include #include #include +#include namespace TCLAP { @@ -62,6 +66,12 @@ class Constraint * functions but without a virtual destructor. */ virtual ~Constraint() { ; } + + static std::string shortID(Constraint *constraint) { + if (!constraint) + throw std::logic_error("Cannot create a ValueArg with a NULL constraint"); + return constraint->shortID(); + } }; } //namespace TCLAP diff --git a/deps/tclap-1.2.2/tclap/DocBookOutput.h b/deps/tclap-1.2.5/tclap/DocBookOutput.h similarity index 98% rename from deps/tclap-1.2.2/tclap/DocBookOutput.h rename to deps/tclap-1.2.5/tclap/DocBookOutput.h index f023824ae..80b10e522 100644 --- a/deps/tclap-1.2.2/tclap/DocBookOutput.h +++ b/deps/tclap-1.2.5/tclap/DocBookOutput.h @@ -5,6 +5,7 @@ * file: DocBookOutput.h * * Copyright (c) 2004, Michael E. Smoot + * Copyright (c) 2017, Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for @@ -100,7 +101,7 @@ inline void DocBookOutput::usage(CmdLineInterface& _cmd ) std::string xversion = _cmd.getVersion(); theDelimiter = _cmd.getDelimiter(); XorHandler xorHandler = _cmd.getXorHandler(); - std::vector< std::vector > xorList = xorHandler.getXorList(); + const std::vector< std::vector > xorList = xorHandler.getXorList(); basename(progName); std::cout << "" << std::endl; @@ -134,7 +135,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 +243,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 +282,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/deps/tclap-1.2.2/tclap/HelpVisitor.h b/deps/tclap-1.2.5/tclap/HelpVisitor.h similarity index 97% rename from deps/tclap-1.2.2/tclap/HelpVisitor.h rename to deps/tclap-1.2.5/tclap/HelpVisitor.h index ee0914420..5ee3756fa 100644 --- a/deps/tclap-1.2.2/tclap/HelpVisitor.h +++ b/deps/tclap-1.2.5/tclap/HelpVisitor.h @@ -1,3 +1,5 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** * diff --git a/deps/tclap-1.2.2/tclap/IgnoreRestVisitor.h b/deps/tclap-1.2.5/tclap/IgnoreRestVisitor.h similarity index 95% rename from deps/tclap-1.2.2/tclap/IgnoreRestVisitor.h rename to deps/tclap-1.2.5/tclap/IgnoreRestVisitor.h index d20f6e075..1824c3c4b 100644 --- a/deps/tclap-1.2.2/tclap/IgnoreRestVisitor.h +++ b/deps/tclap-1.2.5/tclap/IgnoreRestVisitor.h @@ -1,3 +1,5 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** * diff --git a/deps/tclap-1.2.5/tclap/Makefile.am b/deps/tclap-1.2.5/tclap/Makefile.am new file mode 100644 index 000000000..5424fdfae --- /dev/null +++ b/deps/tclap-1.2.5/tclap/Makefile.am @@ -0,0 +1,29 @@ + +libtclapincludedir = $(includedir)/tclap + +libtclapinclude_HEADERS = \ + Arg.h \ + ArgException.h \ + ArgTraits.h \ + CmdLine.h \ + CmdLineInterface.h \ + CmdLineOutput.h \ + Constraint.h \ + DocBookOutput.h \ + HelpVisitor.h \ + IgnoreRestVisitor.h \ + MultiArg.h \ + MultiSwitchArg.h \ + OptionalUnlabeledTracker.h \ + StandardTraits.h \ + StdOutput.h \ + SwitchArg.h \ + UnlabeledMultiArg.h \ + UnlabeledValueArg.h \ + ValueArg.h \ + ValuesConstraint.h \ + VersionVisitor.h \ + Visitor.h \ + XorHandler.h \ + ZshCompletionOutput.h \ + sstream.h diff --git a/deps/tclap-1.2.5/tclap/Makefile.in b/deps/tclap-1.2.5/tclap/Makefile.in new file mode 100644 index 000000000..e84d5f481 --- /dev/null +++ b/deps/tclap-1.2.5/tclap/Makefile.in @@ -0,0 +1,556 @@ +# Makefile.in generated by automake 1.16.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = include/tclap +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/ac_cxx_have_long_long.m4 \ + $(top_srcdir)/config/ac_cxx_have_sstream.m4 \ + $(top_srcdir)/config/ac_cxx_have_strstream.m4 \ + $(top_srcdir)/config/ac_cxx_namespaces.m4 \ + $(top_srcdir)/config/ac_cxx_warn_effective_cxx.m4 \ + $(top_srcdir)/config/bb_enable_doxygen.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libtclapinclude_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libtclapincludedir)" +HEADERS = $(libtclapinclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/config/mkinstalldirs +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOT = @DOT@ +DOXYGEN = @DOXYGEN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARN_EFFECTIVE_CXX = @WARN_EFFECTIVE_CXX@ +WARN_NO_EFFECTIVE_CXX = @WARN_NO_EFFECTIVE_CXX@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +libtclapincludedir = $(includedir)/tclap +libtclapinclude_HEADERS = \ + Arg.h \ + ArgException.h \ + ArgTraits.h \ + CmdLine.h \ + CmdLineInterface.h \ + CmdLineOutput.h \ + Constraint.h \ + DocBookOutput.h \ + HelpVisitor.h \ + IgnoreRestVisitor.h \ + MultiArg.h \ + MultiSwitchArg.h \ + OptionalUnlabeledTracker.h \ + StandardTraits.h \ + StdOutput.h \ + SwitchArg.h \ + UnlabeledMultiArg.h \ + UnlabeledValueArg.h \ + ValueArg.h \ + ValuesConstraint.h \ + VersionVisitor.h \ + Visitor.h \ + XorHandler.h \ + ZshCompletionOutput.h \ + sstream.h + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/tclap/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/tclap/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libtclapincludeHEADERS: $(libtclapinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libtclapinclude_HEADERS)'; test -n "$(libtclapincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libtclapincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libtclapincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libtclapincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libtclapincludedir)" || exit $$?; \ + done + +uninstall-libtclapincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libtclapinclude_HEADERS)'; test -n "$(libtclapincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libtclapincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libtclapincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libtclapincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libtclapincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + cscopelist-am ctags ctags-am distclean distclean-generic \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libtclapincludeHEADERS install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libtclapincludeHEADERS + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/deps/tclap-1.2.2/tclap/MultiArg.h b/deps/tclap-1.2.5/tclap/MultiArg.h similarity index 96% rename from deps/tclap-1.2.2/tclap/MultiArg.h rename to deps/tclap-1.2.5/tclap/MultiArg.h index d478df9b8..e0df8b957 100644 --- a/deps/tclap-1.2.2/tclap/MultiArg.h +++ b/deps/tclap-1.2.5/tclap/MultiArg.h @@ -1,9 +1,12 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** * * file: MultiArg.h * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. + * Copyright (c) 2017, Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for @@ -185,7 +188,7 @@ class MultiArg : public Arg * Returns a vector of type T containing the values parsed from * the command line. */ - const std::vector& getValue(); + const std::vector& getValue() const { return _values; } /** * Returns an iterator over the values parsed from the command @@ -225,8 +228,8 @@ class MultiArg : public Arg /** * Prevent accidental copying */ - MultiArg(const MultiArg& rhs); - MultiArg& operator=(const MultiArg& rhs); + MultiArg(const MultiArg& rhs); + MultiArg& operator=(const MultiArg& rhs); }; @@ -276,7 +279,7 @@ MultiArg::MultiArg(const std::string& flag, Visitor* v) : Arg( flag, name, desc, req, true, v ), _values(std::vector()), - _typeDesc( constraint->shortID() ), + _typeDesc( Constraint::shortID(constraint) ), _constraint( constraint ), _allowMore(false) { @@ -293,7 +296,7 @@ MultiArg::MultiArg(const std::string& flag, Visitor* v) : Arg( flag, name, desc, req, true, v ), _values(std::vector()), - _typeDesc( constraint->shortID() ), + _typeDesc( Constraint::shortID(constraint) ), _constraint( constraint ), _allowMore(false) { @@ -301,9 +304,6 @@ MultiArg::MultiArg(const std::string& flag, _acceptsMultipleValues = true; } -template -const std::vector& MultiArg::getValue() { return _values; } - template bool MultiArg::processArg(int *i, std::vector& args) { @@ -362,7 +362,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/deps/tclap-1.2.2/tclap/MultiSwitchArg.h b/deps/tclap-1.2.5/tclap/MultiSwitchArg.h similarity index 97% rename from deps/tclap-1.2.2/tclap/MultiSwitchArg.h rename to deps/tclap-1.2.5/tclap/MultiSwitchArg.h index 208d9985a..e333ea7b1 100644 --- a/deps/tclap-1.2.2/tclap/MultiSwitchArg.h +++ b/deps/tclap-1.2.5/tclap/MultiSwitchArg.h @@ -1,3 +1,5 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** * @@ -6,6 +8,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. +* Copyright (c) 2017, Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for @@ -108,7 +111,7 @@ class MultiSwitchArg : public SwitchArg /** * Returns int, the number of times the switch has been set. */ - int getValue(); + int getValue() const { return _value; } /** * Returns the shortID for this Arg. @@ -150,8 +153,6 @@ _default( init ) parser.add( this ); } -inline int MultiSwitchArg::getValue() { return _value; } - inline bool MultiSwitchArg::processArg(int *i, std::vector& args) { if ( _ignoreable && Arg::ignoreRest() ) @@ -192,7 +193,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/deps/tclap-1.2.2/tclap/OptionalUnlabeledTracker.h b/deps/tclap-1.2.5/tclap/OptionalUnlabeledTracker.h similarity index 96% rename from deps/tclap-1.2.2/tclap/OptionalUnlabeledTracker.h rename to deps/tclap-1.2.5/tclap/OptionalUnlabeledTracker.h index 92f892978..aa64116dc 100644 --- a/deps/tclap-1.2.2/tclap/OptionalUnlabeledTracker.h +++ b/deps/tclap-1.2.5/tclap/OptionalUnlabeledTracker.h @@ -1,3 +1,5 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** diff --git a/deps/tclap-1.2.5/tclap/StandardTraits.h b/deps/tclap-1.2.5/tclap/StandardTraits.h new file mode 100644 index 000000000..5864f7787 --- /dev/null +++ b/deps/tclap-1.2.5/tclap/StandardTraits.h @@ -0,0 +1,63 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + +/****************************************************************************** + * + * file: StandardTraits.h + * + * Copyright (c) 2007, Daniel Aarno, Michael E. Smoot . + * Copyright (c) 2017, Google LLC + * 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. + * + *****************************************************************************/ + +// This is an internal tclap file, you should probably not have to +// include this directly + +#ifndef TCLAP_STANDARD_TRAITS_H +#define TCLAP_STANDARD_TRAITS_H + +#ifdef HAVE_CONFIG_H +#include // To check for long long +#endif + +// If Microsoft has already typedef'd wchar_t as an unsigned +// short, then compiles will break because it's as if we're +// creating ArgTraits twice for unsigned short. Thus... +#ifdef _MSC_VER +#ifndef _NATIVE_WCHAR_T_DEFINED +#define TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS +#endif +#endif + +namespace TCLAP { + +// Integer types (signed, unsigned and bool) and floating point types all +// have value-like semantics. + +// Strings have string like argument traits. +template<> +struct ArgTraits { + typedef StringLike ValueCategory; +}; + +template +void SetString(T &dst, const std::string &src) +{ + dst = src; +} + +} // namespace + +#endif + diff --git a/deps/tclap-1.2.2/tclap/StdOutput.h b/deps/tclap-1.2.5/tclap/StdOutput.h similarity index 99% rename from deps/tclap-1.2.2/tclap/StdOutput.h rename to deps/tclap-1.2.5/tclap/StdOutput.h index f224ea205..cfef79a14 100644 --- a/deps/tclap-1.2.2/tclap/StdOutput.h +++ b/deps/tclap-1.2.5/tclap/StdOutput.h @@ -5,6 +5,7 @@ * file: StdOutput.h * * Copyright (c) 2004, Michael E. Smoot + * Copyright (c) 2017, Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for diff --git a/deps/tclap-1.2.5/tclap/SwitchArg.h b/deps/tclap-1.2.5/tclap/SwitchArg.h new file mode 100644 index 000000000..4ca130da4 --- /dev/null +++ b/deps/tclap-1.2.5/tclap/SwitchArg.h @@ -0,0 +1,273 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + +/****************************************************************************** + * + * file: SwitchArg.h + * + * Copyright (c) 2003, Michael E. Smoot . + * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. + * Copyright (c) 2017, Google LLC + * 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_SWITCH_ARG_H +#define TCLAP_SWITCH_ARG_H + +#include +#include + +#include + +namespace TCLAP { + +/** + * A simple switch argument. If the switch is set on the command line, then + * the getValue method will return the opposite of the default value for the + * switch. + */ +class SwitchArg : public Arg +{ +protected: + + /** + * The value of the switch. + */ + bool _value; + + /** + * Used to support the reset() method so that ValueArg can be + * reset to their constructed value. + */ + bool _default; + +public: + + /** + * SwitchArg constructor. + * \param flag - The one character flag that identifies this + * argument on the command line. + * \param name - A one word name for the argument. Can be + * used as a long flag on the command line. + * \param desc - A description of what the argument is for or + * does. + * \param def - The default value for this Switch. + * \param v - An optional visitor. You probably should not + * use this unless you have a very good reason. + */ + SwitchArg(const std::string& flag, + const std::string& name, + const std::string& desc, + bool def = false, + Visitor* v = NULL); + + + /** + * SwitchArg constructor. + * \param flag - The one character flag that identifies this + * argument on the command line. + * \param name - A one word name for the argument. Can be + * used as a long flag on the command line. + * \param desc - A description of what the argument is for or + * does. + * \param parser - A CmdLine parser object to add this Arg to + * \param def - The default value for this Switch. + * \param v - An optional visitor. You probably should not + * use this unless you have a very good reason. + */ + SwitchArg(const std::string& flag, + const std::string& name, + const std::string& desc, + CmdLineInterface& parser, + bool def = false, + Visitor* v = NULL); + + + /** + * Handles the processing of the argument. + * This re-implements the Arg version of this method to set the + * _value of the argument appropriately. + * \param i - Pointer the the current argument in the list. + * \param args - Mutable list of strings. Passed + * in from main(). + */ + virtual bool processArg(int* i, std::vector& args); + + /** + * Checks a string to see if any of the chars in the string + * match the flag for this Switch. + */ + bool combinedSwitchesMatch(std::string& combined); + + /** + * Returns bool, whether or not the switch has been set. + */ + bool getValue() const { return _value; } + + /** + * A SwitchArg can be used as a boolean, indicating + * whether or not the switch has been set. This is the + * same as calling getValue() + */ + operator bool() const { return _value; } + + virtual void reset(); + +private: + /** + * Checks to see if we've found the last match in + * a combined string. + */ + bool lastCombined(std::string& combined); + + /** + * Does the common processing of processArg. + */ + void commonProcessing(); +}; + +////////////////////////////////////////////////////////////////////// +//BEGIN SwitchArg.cpp +////////////////////////////////////////////////////////////////////// +inline SwitchArg::SwitchArg(const std::string& flag, + const std::string& name, + const std::string& desc, + bool default_val, + Visitor* v ) + : Arg(flag, name, desc, false, false, v), + _value( default_val ), + _default( default_val ) +{ } + +inline SwitchArg::SwitchArg(const std::string& flag, + const std::string& name, + const std::string& desc, + CmdLineInterface& parser, + bool default_val, + Visitor* v ) + : Arg(flag, name, desc, false, false, v), + _value( default_val ), + _default(default_val) +{ + parser.add( this ); +} + +inline bool SwitchArg::lastCombined(std::string& combinedSwitches ) +{ + for ( unsigned int i = 1; i < combinedSwitches.length(); i++ ) + if ( combinedSwitches[i] != Arg::blankChar() ) + return false; + + return true; +} + +inline bool SwitchArg::combinedSwitchesMatch(std::string& combinedSwitches ) +{ + // make sure this is actually a combined switch + if ( combinedSwitches.length() > 0 && + combinedSwitches[0] != Arg::flagStartString()[0] ) + return false; + + // make sure it isn't a long name + if ( combinedSwitches.substr( 0, Arg::nameStartString().length() ) == + Arg::nameStartString() ) + return false; + + // make sure the delimiter isn't in the string + if ( combinedSwitches.find_first_of(Arg::delimiter()) != std::string::npos) + return false; + + // ok, we're not specifying a ValueArg, so we know that we have + // a combined switch list. + for ( unsigned int i = 1; i < combinedSwitches.length(); i++ ) + if ( _flag.length() > 0 && + combinedSwitches[i] == _flag[0] && + _flag[0] != Arg::flagStartString()[0] ) + { + // update the combined switches so this one is no longer present + // this is necessary so that no unlabeled args are matched + // later in the processing. + //combinedSwitches.erase(i,1); + combinedSwitches[i] = Arg::blankChar(); + return true; + } + + // none of the switches passed in the list match. + return false; +} + +inline void SwitchArg::commonProcessing() +{ + if ( _xorSet ) + throw(CmdLineParseException( + "Mutually exclusive argument already set!", toString())); + + if ( _alreadySet ) + throw(CmdLineParseException("Argument already set!", toString())); + + _alreadySet = true; + + if ( _value == true ) + _value = false; + else + _value = true; + + _checkWithVisitor(); +} + +inline bool SwitchArg::processArg(int *i, std::vector& args) +{ + if ( _ignoreable && Arg::ignoreRest() ) + return false; + + // if the whole string matches the flag or name string + if ( argMatches( args[*i] ) ) + { + commonProcessing(); + + return true; + } + // if a substring matches the flag as part of a combination + else if ( combinedSwitchesMatch( args[*i] ) ) + { + // check again to ensure we don't misinterpret + // this as a MultiSwitchArg + if ( combinedSwitchesMatch( args[*i] ) ) + throw(CmdLineParseException("Argument already set!", + toString())); + + commonProcessing(); + + // We only want to return true if we've found the last combined + // match in the string, otherwise we return true so that other + // switches in the combination will have a chance to match. + return lastCombined( args[*i] ); + } + else + return false; +} + +inline void SwitchArg::reset() +{ + Arg::reset(); + _value = _default; +} +////////////////////////////////////////////////////////////////////// +//End SwitchArg.cpp +////////////////////////////////////////////////////////////////////// + +} //namespace TCLAP + +#endif diff --git a/deps/tclap-1.2.2/tclap/UnlabeledMultiArg.h b/deps/tclap-1.2.5/tclap/UnlabeledMultiArg.h similarity index 99% rename from deps/tclap-1.2.2/tclap/UnlabeledMultiArg.h rename to deps/tclap-1.2.5/tclap/UnlabeledMultiArg.h index 7995bc296..48feb84ed 100644 --- a/deps/tclap-1.2.2/tclap/UnlabeledMultiArg.h +++ b/deps/tclap-1.2.5/tclap/UnlabeledMultiArg.h @@ -1,9 +1,12 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** * * file: UnlabeledMultiArg.h * * Copyright (c) 2003, Michael E. Smoot. + * Copyright (c) 2017, Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for diff --git a/deps/tclap-1.2.2/tclap/UnlabeledValueArg.h b/deps/tclap-1.2.5/tclap/UnlabeledValueArg.h similarity index 99% rename from deps/tclap-1.2.2/tclap/UnlabeledValueArg.h rename to deps/tclap-1.2.5/tclap/UnlabeledValueArg.h index 25e85ff11..341a3c062 100644 --- a/deps/tclap-1.2.2/tclap/UnlabeledValueArg.h +++ b/deps/tclap-1.2.5/tclap/UnlabeledValueArg.h @@ -1,3 +1,5 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** * @@ -5,6 +7,7 @@ * * Copyright (c) 2003, Michael E. Smoot . * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. + * Copyright (c) 2017, Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for diff --git a/deps/tclap-1.2.5/tclap/ValueArg.h b/deps/tclap-1.2.5/tclap/ValueArg.h new file mode 100644 index 000000000..791d93f96 --- /dev/null +++ b/deps/tclap-1.2.5/tclap/ValueArg.h @@ -0,0 +1,430 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + +/****************************************************************************** + * + * file: ValueArg.h + * + * Copyright (c) 2003, Michael E. Smoot . + * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno. + * Copyright (c) 2017, Google LLC + * 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_VALUE_ARGUMENT_H +#define TCLAP_VALUE_ARGUMENT_H + +#include +#include + +#include +#include + +namespace TCLAP { + +/** + * The basic labeled argument that parses a value. + * This is a template class, which means the type T defines the type + * that a given object will attempt to parse when the flag/name is matched + * on the command line. While there is nothing stopping you from creating + * an unflagged ValueArg, it is unwise and would cause significant problems. + * Instead use an UnlabeledValueArg. + */ +template +class ValueArg : public Arg +{ +protected: + + /** + * The value parsed from the command line. + * Can be of any type, as long as the >> operator for the type + * is defined. + */ + T _value; + + /** + * Used to support the reset() method so that ValueArg can be + * reset to their constructed value. + */ + T _default; + + /** + * A human readable description of the type to be parsed. + * This is a hack, plain and simple. Ideally we would use RTTI to + * return the name of type T, but until there is some sort of + * consistent support for human readable names, we are left to our + * own devices. + */ + std::string _typeDesc; + + /** + * A Constraint this Arg must conform to. + */ + Constraint* _constraint; + + /** + * Extracts the value from the string. + * Attempts to parse string as type T, if this fails an exception + * is thrown. + * \param val - value to be parsed. + */ + void _extractValue( const std::string& val ); + +public: + + /** + * Labeled ValueArg constructor. + * You could conceivably call this constructor with a blank flag, + * but that would make you a bad person. It would also cause + * an exception to be thrown. If you want an unlabeled argument, + * use the other constructor. + * \param flag - The one character flag that identifies this + * argument on the command line. + * \param name - A one word name for the argument. Can be + * used as a long flag on the command line. + * \param desc - A description of what the argument is for or + * does. + * \param req - Whether the argument is required on the command + * line. + * \param value - The default value assigned to this argument if it + * is not present on the command line. + * \param typeDesc - A short, human readable description of the + * type that this object expects. This is used in the generation + * of the USAGE statement. The goal is to be helpful to the end user + * of the program. + * \param v - An optional visitor. You probably should not + * use this unless you have a very good reason. + */ + ValueArg( const std::string& flag, + const std::string& name, + const std::string& desc, + bool req, + T value, + const std::string& typeDesc, + Visitor* v = NULL); + + + /** + * Labeled ValueArg constructor. + * You could conceivably call this constructor with a blank flag, + * but that would make you a bad person. It would also cause + * an exception to be thrown. If you want an unlabeled argument, + * use the other constructor. + * \param flag - The one character flag that identifies this + * argument on the command line. + * \param name - A one word name for the argument. Can be + * used as a long flag on the command line. + * \param desc - A description of what the argument is for or + * does. + * \param req - Whether the argument is required on the command + * line. + * \param value - The default value assigned to this argument if it + * is not present on the command line. + * \param typeDesc - A short, human readable description of the + * type that this object expects. This is used in the generation + * of the USAGE statement. The goal is to be helpful to the end user + * of the program. + * \param parser - A CmdLine parser object to add this Arg to + * \param v - An optional visitor. You probably should not + * use this unless you have a very good reason. + */ + ValueArg( const std::string& flag, + const std::string& name, + const std::string& desc, + bool req, + T value, + const std::string& typeDesc, + CmdLineInterface& parser, + Visitor* v = NULL ); + + /** + * Labeled ValueArg constructor. + * You could conceivably call this constructor with a blank flag, + * but that would make you a bad person. It would also cause + * an exception to be thrown. If you want an unlabeled argument, + * use the other constructor. + * \param flag - The one character flag that identifies this + * argument on the command line. + * \param name - A one word name for the argument. Can be + * used as a long flag on the command line. + * \param desc - A description of what the argument is for or + * does. + * \param req - Whether the argument is required on the command + * line. + * \param value - The default value assigned to this argument if it + * is not present on the command line. + * \param constraint - A pointer to a Constraint object used + * to constrain this Arg. + * \param parser - A CmdLine parser object to add this Arg to. + * \param v - An optional visitor. You probably should not + * use this unless you have a very good reason. + */ + ValueArg( const std::string& flag, + const std::string& name, + const std::string& desc, + bool req, + T value, + Constraint* constraint, + CmdLineInterface& parser, + Visitor* v = NULL ); + + /** + * Labeled ValueArg constructor. + * You could conceivably call this constructor with a blank flag, + * but that would make you a bad person. It would also cause + * an exception to be thrown. If you want an unlabeled argument, + * use the other constructor. + * \param flag - The one character flag that identifies this + * argument on the command line. + * \param name - A one word name for the argument. Can be + * used as a long flag on the command line. + * \param desc - A description of what the argument is for or + * does. + * \param req - Whether the argument is required on the command + * line. + * \param value - The default value assigned to this argument if it + * is not present on the command line. + * \param constraint - A pointer to a Constraint object used + * to constrain this Arg. + * \param v - An optional visitor. You probably should not + * use this unless you have a very good reason. + */ + ValueArg( const std::string& flag, + const std::string& name, + const std::string& desc, + bool req, + T value, + Constraint* constraint, + Visitor* v = NULL ); + + /** + * Handles the processing of the argument. + * This re-implements the Arg version of this method to set the + * _value of the argument appropriately. It knows the difference + * between labeled and unlabeled. + * \param i - Pointer the the current argument in the list. + * \param args - Mutable list of strings. Passed + * in from main(). + */ + virtual bool processArg(int* i, std::vector& args); + + /** + * Returns the value of the argument. + */ + const T& getValue() const { return _value; } + + // TODO(macbishop): Non-const variant is deprecated, don't + // use. Remove in next major. + T& getValue() { return _value; } + + /** + * A ValueArg can be used as as its value type (T) This is the + * same as calling getValue() + */ + operator const T&() const { return getValue(); } + + /** + * Specialization of shortID. + * \param val - value to be used. + */ + virtual std::string shortID(const std::string& val = "val") const; + + /** + * Specialization of longID. + * \param val - value to be used. + */ + virtual std::string longID(const std::string& val = "val") const; + + virtual void reset() ; + +private: + /** + * Prevent accidental copying + */ + ValueArg(const ValueArg& rhs); + ValueArg& operator=(const ValueArg& rhs); +}; + + +/** + * Constructor implementation. + */ +template +ValueArg::ValueArg(const std::string& flag, + const std::string& name, + const std::string& desc, + bool req, + T val, + const std::string& typeDesc, + Visitor* v) + : Arg(flag, name, desc, req, true, v), + _value( val ), + _default( val ), + _typeDesc( typeDesc ), + _constraint( NULL ) +{ } + +template +ValueArg::ValueArg(const std::string& flag, + const std::string& name, + const std::string& desc, + bool req, + T val, + const std::string& typeDesc, + CmdLineInterface& parser, + Visitor* v) + : Arg(flag, name, desc, req, true, v), + _value( val ), + _default( val ), + _typeDesc( typeDesc ), + _constraint( NULL ) +{ + parser.add( this ); +} + +template +ValueArg::ValueArg(const std::string& flag, + const std::string& name, + const std::string& desc, + bool req, + T val, + Constraint* constraint, + Visitor* v) + : Arg(flag, name, desc, req, true, v), + _value( val ), + _default( val ), + _typeDesc( Constraint::shortID(constraint) ), + _constraint( constraint ) +{ } + +template +ValueArg::ValueArg(const std::string& flag, + const std::string& name, + const std::string& desc, + bool req, + T val, + Constraint* constraint, + CmdLineInterface& parser, + Visitor* v) + : Arg(flag, name, desc, req, true, v), + _value( val ), + _default( val ), + _typeDesc( Constraint::shortID(constraint) ), // TODO(macbishop): Will crash + // if constraint is NULL + _constraint( constraint ) +{ + parser.add( this ); +} + +/** + * Implementation of processArg(). + */ +template +bool ValueArg::processArg(int *i, std::vector& args) +{ + if ( _ignoreable && Arg::ignoreRest() ) + return false; + + if ( _hasBlanks( args[*i] ) ) + return false; + + std::string flag = args[*i]; + + std::string value = ""; + trimFlag( flag, value ); + + if ( argMatches( flag ) ) + { + if ( _alreadySet ) + { + if ( _xorSet ) + throw( CmdLineParseException("Mutually exclusive argument" + " already set!", toString())); + else + throw( CmdLineParseException("Argument already set!", + toString()) ); + } + + if ( Arg::delimiter() != ' ' && value == "" ) + throw( ArgParseException("Couldn't find delimiter for this argument!", + toString() ) ); + + if ( value == "" ) + { + (*i)++; + if ( static_cast(*i) < args.size() ) + _extractValue( args[*i] ); + else + throw( ArgParseException("Missing a value for this argument!", + toString() ) ); + } + else + _extractValue( value ); + + _alreadySet = true; + _checkWithVisitor(); + return true; + } + else + return false; +} + +/** + * Implementation of shortID. + */ +template +std::string ValueArg::shortID(const std::string& val) const +{ + static_cast(val); // Ignore input, don't warn + return Arg::shortID( _typeDesc ); +} + +/** + * Implementation of longID. + */ +template +std::string ValueArg::longID(const std::string& val) const +{ + static_cast(val); // Ignore input, don't warn + return Arg::longID( _typeDesc ); +} + +template +void ValueArg::_extractValue( const std::string& val ) +{ + try { + ExtractValue(_value, val, typename ArgTraits::ValueCategory()); + } catch( ArgParseException &e) { + throw ArgParseException(e.error(), toString()); + } + + if ( _constraint != NULL ) + if ( ! _constraint->check( _value ) ) + throw( CmdLineParseException( "Value '" + val + + + "' does not meet constraint: " + + _constraint->description(), + toString() ) ); +} + +template +void ValueArg::reset() +{ + Arg::reset(); + _value = _default; +} + +} // namespace TCLAP + +#endif diff --git a/deps/tclap-1.2.2/tclap/ValuesConstraint.h b/deps/tclap-1.2.5/tclap/ValuesConstraint.h similarity index 91% rename from deps/tclap-1.2.2/tclap/ValuesConstraint.h rename to deps/tclap-1.2.5/tclap/ValuesConstraint.h index d1c1df701..985143293 100644 --- a/deps/tclap-1.2.2/tclap/ValuesConstraint.h +++ b/deps/tclap-1.2.5/tclap/ValuesConstraint.h @@ -1,3 +1,5 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** @@ -5,6 +7,7 @@ * file: ValuesConstraint.h * * Copyright (c) 2005, Michael E. Smoot + * Copyright (c) 2017, Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for @@ -48,7 +51,7 @@ class ValuesConstraint : public Constraint * Constructor. * \param allowed - vector of allowed values. */ - ValuesConstraint(std::vector& allowed); + ValuesConstraint(std::vectorconst& allowed); /** * Virtual destructor. @@ -87,21 +90,13 @@ class ValuesConstraint : public Constraint }; template -ValuesConstraint::ValuesConstraint(std::vector& allowed) +ValuesConstraint::ValuesConstraint(std::vector const& allowed) : _allowed(allowed), _typeDesc("") { for ( unsigned int i = 0; i < _allowed.size(); i++ ) { - -#if defined(HAVE_SSTREAM) std::ostringstream os; -#elif defined(HAVE_STRSTREAM) - std::ostrstream os; -#else -#error "Need a stringstream (sstream or strstream) to compile!" -#endif - os << _allowed[i]; std::string temp( os.str() ); diff --git a/deps/tclap-1.2.2/tclap/VersionVisitor.h b/deps/tclap-1.2.5/tclap/VersionVisitor.h similarity index 100% rename from deps/tclap-1.2.2/tclap/VersionVisitor.h rename to deps/tclap-1.2.5/tclap/VersionVisitor.h diff --git a/deps/tclap-1.2.2/tclap/Visitor.h b/deps/tclap-1.2.5/tclap/Visitor.h similarity index 84% rename from deps/tclap-1.2.2/tclap/Visitor.h rename to deps/tclap-1.2.5/tclap/Visitor.h index 393320a3e..2a7bfd165 100644 --- a/deps/tclap-1.2.2/tclap/Visitor.h +++ b/deps/tclap-1.2.5/tclap/Visitor.h @@ -1,9 +1,12 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** * * file: Visitor.h * * Copyright (c) 2003, Michael E. Smoot . + * Copyright (c) 2017, Google LLC * All rights reserved. * * See the file COPYING in the top directory of this distribution for @@ -43,9 +46,10 @@ class Visitor virtual ~Visitor() { } /** - * Does nothing. Should be overridden by child. + * This method (to implemented by children) will be + * called when the visitor is visited. */ - virtual void visit() { } + virtual void visit() = 0; }; } diff --git a/deps/tclap-1.2.2/tclap/XorHandler.h b/deps/tclap-1.2.5/tclap/XorHandler.h similarity index 93% rename from deps/tclap-1.2.2/tclap/XorHandler.h rename to deps/tclap-1.2.5/tclap/XorHandler.h index 64fcffce1..e80f9ee3a 100644 --- a/deps/tclap-1.2.2/tclap/XorHandler.h +++ b/deps/tclap-1.2.5/tclap/XorHandler.h @@ -1,3 +1,5 @@ +// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- + /****************************************************************************** * @@ -55,8 +57,8 @@ class XorHandler * 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 ); - + void add( const std::vector& ors ); + /** * Checks whether the specified Arg is in one of the xor lists and * if it does match one, returns the size of the xor list that the @@ -84,7 +86,7 @@ class XorHandler */ bool contains( const Arg* a ); - std::vector< std::vector >& getXorList(); + const std::vector< std::vector >& getXorList() const; }; @@ -92,8 +94,8 @@ class XorHandler ////////////////////////////////////////////////////////////////////// //BEGIN XOR.cpp ////////////////////////////////////////////////////////////////////// -inline void XorHandler::add( std::vector& ors ) -{ +inline void XorHandler::add( const std::vector& ors ) +{ _orList.push_back( ors ); } @@ -150,7 +152,7 @@ inline bool XorHandler::contains( const Arg* a ) return false; } -inline std::vector< std::vector >& XorHandler::getXorList() +inline const std::vector< std::vector >& XorHandler::getXorList() const { return _orList; } diff --git a/deps/tclap-1.2.2/tclap/ZshCompletionOutput.h b/deps/tclap-1.2.5/tclap/ZshCompletionOutput.h similarity index 98% rename from deps/tclap-1.2.2/tclap/ZshCompletionOutput.h rename to deps/tclap-1.2.5/tclap/ZshCompletionOutput.h index acf655bf7..5a9268c87 100644 --- a/deps/tclap-1.2.2/tclap/ZshCompletionOutput.h +++ b/deps/tclap-1.2.5/tclap/ZshCompletionOutput.h @@ -237,8 +237,9 @@ 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/deps/tclap-1.2.2/tclap/sstream.h b/deps/tclap-1.2.5/tclap/sstream.h similarity index 100% rename from deps/tclap-1.2.2/tclap/sstream.h rename to deps/tclap-1.2.5/tclap/sstream.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e5b27db94..7768c89dd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT USE_SYSTEM_RAPIDJSON) include_directories(../deps/rapidjson-1.1.0) endif() if(NOT USE_SYSTEM_TCLAP) - include_directories(../deps/tclap-1.2.2) + include_directories(../deps/tclap-1.2.5) endif() # Library