From 891ad5173045138cbd8daa76c278f9c379f5d514 Mon Sep 17 00:00:00 2001 From: mes5k Date: Thu, 13 Sep 2007 02:09:48 +0000 Subject: [PATCH] fixed the delimiter in Arg::longID and Arg::shortID --- include/tclap/Arg.h | 9 +++------ tests/test42.out | 6 +++--- tests/test54.out | 6 +++--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/include/tclap/Arg.h b/include/tclap/Arg.h index 4cdda56..beb6245 100644 --- a/include/tclap/Arg.h +++ b/include/tclap/Arg.h @@ -504,11 +504,8 @@ inline std::string Arg::shortID( const std::string& valueId ) const else id = Arg::nameStartString() + _name; - std::string delim = " "; - delim[0] = Arg::delimiter(); // ugly!!! - if ( _valueRequired ) - id += delim + "<" + valueId + ">"; + id += std::string( 1, Arg::delimiter() ) + "<" + valueId + ">"; if ( !_required ) id = "[" + id + "]"; @@ -525,7 +522,7 @@ inline std::string Arg::longID( const std::string& valueId ) const id += Arg::flagStartString() + _flag; if ( _valueRequired ) - id += " <" + valueId + ">"; + id += std::string( 1, Arg::delimiter() ) + "<" + valueId + ">"; id += ", "; } @@ -533,7 +530,7 @@ inline std::string Arg::longID( const std::string& valueId ) const id += Arg::nameStartString() + _name; if ( _valueRequired ) - id += " <" + valueId + ">"; + id += std::string( 1, Arg::delimiter() ) + "<" + valueId + ">"; return id; diff --git a/tests/test42.out b/tests/test42.out index 86e9016..4c95064 100644 --- a/tests/test42.out +++ b/tests/test42.out @@ -8,13 +8,13 @@ USAGE: Where: - -f , --floatTest (accepted multiple times) + -f=, --floatTest= (accepted multiple times) multi float test - -i , --intTest (accepted multiple times) + -i=, --intTest= (accepted multiple times) multi int test - --stringTest + --stringTest= (required) string test -B, --existTestB diff --git a/tests/test54.out b/tests/test54.out index f92b812..9837b22 100644 --- a/tests/test54.out +++ b/tests/test54.out @@ -8,13 +8,13 @@ USAGE: Where: - -f , --floatTest (accepted multiple times) + -f=, --floatTest= (accepted multiple times) multi float test - -i , --intTest (accepted multiple times) + -i=, --intTest= (accepted multiple times) multi int test - -s , --stringTest + -s=, --stringTest= (required) string test -B, --existTestB