Changeset 7260 in orxonox.OLD for trunk/src/lib/parser
- Timestamp:
- Mar 30, 2006, 5:44:37 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/parser/cmdline_parser/cmdline_parser.cc
r7259 r7260 68 68 if ( s.find( "=" ) == std::string::npos ) 69 69 { 70 args.push_back(s); 70 if ( s.length() > 2 && s[0] == '-' && s[1] != '-' ) 71 { 72 for ( int j = 1; j < s.length(); j++ ) 73 { 74 std::string t = "-"; 75 t += s[j]; 76 args.push_back( t ); 77 } 78 } 79 else 80 { 81 args.push_back(s); 82 } 71 83 } 72 84 else … … 98 110 found = true; 99 111 100 if ( it->numArgs + i >= args.size() ) 112 int posArgs = 1; 113 114 while ( i + posArgs < args.size() ) 115 { 116 if ( args[ i + posArgs ].length() > 0 && args[ i + posArgs ][0] == '-' ) 117 break; 118 else 119 posArgs++; 120 } 121 122 posArgs--; 123 124 if ( it->numArgs > posArgs ) 101 125 { 102 126 PRINTF(1)( "%s needs %d arguments!\n", args[i].c_str(), it->numArgs ); … … 176 200 } 177 201 } 202 else 203 return false; 178 204 } 179 205
Note: See TracChangeset
for help on using the changeset viewer.