From cad795c4b8825ef65c454b98a633d58d497c67e1 Mon Sep 17 00:00:00 2001 From: mes5k Date: Tue, 6 May 2008 06:02:02 +0000 Subject: [PATCH] tweaked tests to support dashes in arg names --- examples/test7.cpp | 4 ++-- include/tclap/Arg.h | 2 +- tests/test46.out | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/test7.cpp b/examples/test7.cpp index 19b3e41..0d91e6e 100644 --- a/examples/test7.cpp +++ b/examples/test7.cpp @@ -40,14 +40,14 @@ int main(int argc, char **argv) false, -10, "negative int"); cmd.add( gapCreate ); - ValueArg gapExtend("g","gapExtend", + ValueArg gapExtend("g","gap-Extend", "The cost for each extension of a gap", false, -2, "negative int"); cmd.add( gapExtend ); SwitchArg dna("d","isDna","The input sequences are DNA", false); cmd.add( dna ); - ValueArg scoringMatrixName("s","scoringMatrix", + ValueArg scoringMatrixName("s","scoring--Matrix", "Scoring Matrix name", false,"BLOSUM50","name string"); cmd.add( scoringMatrixName ); diff --git a/include/tclap/Arg.h b/include/tclap/Arg.h index dfc6eaa..7674e7f 100644 --- a/include/tclap/Arg.h +++ b/include/tclap/Arg.h @@ -453,7 +453,7 @@ inline Arg::Arg(const std::string& flag, if ( ( _name.substr( 0, Arg::flagStartString().length() ) == Arg::flagStartString() ) || ( _name.substr( 0, Arg::nameStartString().length() ) == Arg::nameStartString() ) || ( _name.find( " ", 0 ) != std::string::npos ) ) - throw(SpecificationException("Argument name cannot contain either '" + + throw(SpecificationException("Argument name begin with either '" + Arg::flagStartString() + "' or '" + Arg::nameStartString() + "' or space.", toString() ) ); diff --git a/tests/test46.out b/tests/test46.out index a438101..8981c67 100644 --- a/tests/test46.out +++ b/tests/test46.out @@ -29,13 +29,13 @@ Where: -x , --filename1 Sequence 1 filename (FASTA format) - -s , --scoringMatrix + -s , --scoring--Matrix Scoring Matrix name -d, --isDna The input sequences are DNA - -g , --gapExtend + -g , --gap-Extend The cost for each extension of a gap -f , --gapCreate