| 272 | |
| 273 | |
| 274 | bool ExtractCommandLineArguments( ProgramArguments& args, int argc, char* argv[] ) |
| 275 | { |
| 276 | for( int i = 1; i < argc; ++i ) |
| 277 | { |
| 278 | if( strcmp( argv[i], "/threads" ) == 0 ) |
| 279 | { |
| 280 | ++i; |
| 281 | if( i < argc ) |
| 282 | { |
| 283 | args.coreCount = std::max( atoi( argv[i] ), 1 ); |
| 284 | } |
| 285 | else |
| 286 | { |
| 287 | return false; |
| 288 | } |
| 289 | } |
| 290 | else if( strcmp( argv[i], "/no_warnings" ) == 0 ) |
| 291 | { |
| 292 | g_printWarnings = false; |
| 293 | } |
| 294 | else if( strcmp( argv[i], "/single" ) == 0 ) |
| 295 | { |
| 296 | } |
| 297 | else if( strcmp( argv[i], "/permutations" ) == 0 ) |
| 298 | { |
| 299 | args.printPermutations = true; |
| 300 | } |
| 301 | else if( strcmp( argv[i], "/no_permutations" ) == 0 ) |
| 302 | { |
| 303 | args.ignorePermutations = true; |
| 304 | } |
| 305 | else if( strcmp( argv[i], "/define" ) == 0 ) |
| 306 | { |
| 307 | Macro define; |
| 308 | ++i; |
| 309 | if( i < argc ) |
| 310 | { |
| 311 | define.name = argv[i]; |
| 312 | } |
| 313 | else |
| 314 | { |
| 315 | return false; |
| 316 | } |
| 317 | ++i; |
| 318 | if( i < argc ) |
| 319 | { |
| 320 | define.value = argv[i]; |
| 321 | } |
| 322 | else |
| 323 | { |
| 324 | return false; |
| 325 | } |
| 326 | args.defines.push_back( define ); |
| 327 | } |
| 328 | else if( strcmp( argv[i], "/listing" ) == 0 ) |
| 329 | { |
| 330 | g_generateListing = true; |
| 331 | ++i; |