|
@@ -30,8 +30,25 @@ int Options::parseCharOption( int argc, char** argv, int argumentIndex, int vali
|
30
|
30
|
// If we're a flag, we take no arguments, nor do we allow = signs or whatever.
|
31
|
31
|
if ( isFlagArgument[validIndex] ) {
|
32
|
32
|
if ( argument != std::string()+"-"+validCharArguments[validIndex] ) {
|
33
|
|
- throw new std::invalid_argument( std::string()+"Unexpected characters around flag `" + argument + "`." );
|
34
|
|
- return 0;
|
|
33
|
+ for( int o=1;o<argument.length();o++ ) {
|
|
34
|
+ bool isValid = false;
|
|
35
|
+ for( int i=0;i<validArgumentCount&&!isValid;i++ ) {
|
|
36
|
+ if ( argument[o] == validCharArguments[i] ) {
|
|
37
|
+ if ( isFlagArgument[i] ) {
|
|
38
|
+ isValid = true;
|
|
39
|
+ arguments.push_back( std::string()+validCharArguments[i] );
|
|
40
|
+ values.push_back("");
|
|
41
|
+ break;
|
|
42
|
+ } else {
|
|
43
|
+ throw new std::invalid_argument( std::string()+"Truncating non-flag arguments is not allowed. Split this up: `" + argument + "`." );
|
|
44
|
+ }
|
|
45
|
+ }
|
|
46
|
+ }
|
|
47
|
+ if (!isValid) {
|
|
48
|
+ throw new std::invalid_argument( std::string()+"Unexpected characters around flag `" + argument + "`." );
|
|
49
|
+ }
|
|
50
|
+ }
|
|
51
|
+ return 1;
|
35
|
52
|
} else {
|
36
|
53
|
arguments.push_back( std::string()+argument[1] );
|
37
|
54
|
values.push_back("");
|