Changeset 1a69a90 for src/main.cc
- Timestamp:
- Nov 21, 2019, 1:03:17 PM (4 years ago)
- Branches:
- ADT, arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 49d3128
- Parents:
- 665f432
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r665f432 r1a69a90 407 407 408 408 409 static const char optstring[] = ": hlLmNnpP:S:tgwW:D:";409 static const char optstring[] = ":c:ghlLmNnpP:S:twW:D:"; 410 410 411 411 enum { PreludeDir = 128 }; 412 412 static struct option long_opts[] = { 413 { "colors", required_argument, nullptr, 'c' }, 414 { "gdb", no_argument, nullptr, 'g' }, 413 415 { "help", no_argument, nullptr, 'h' }, 414 416 { "libcfa", no_argument, nullptr, 'l' }, … … 422 424 { "statistics", required_argument, nullptr, 'S' }, 423 425 { "tree", no_argument, nullptr, 't' }, 424 { "gdb", no_argument, nullptr, 'g' },425 426 { "", no_argument, nullptr, 0 }, // -w 426 427 { "", no_argument, nullptr, 0 }, // -W … … 430 431 431 432 static const char * description[] = { 433 "Use color in diagnostics. WHEN is ‘never’, ‘always’, or ‘auto’.",// -c 434 "wait for gdb to attach", // -g 432 435 "print help message", // -h 433 436 "generate libcfa.c", // -l … … 441 444 "<option-list> enable profiling information:\n counters,heap,time,all,none", // -S 442 445 "building cfa standard lib", // -t 443 "wait for gdb to attach", // -g444 446 "", // -w 445 447 "", // -W … … 512 514 while ( (c = getopt_long( argc, argv, optstring, long_opts, nullptr )) != -1 ) { 513 515 switch ( c ) { 516 case 'c': // diagnostic colors 517 if ( strcmp( optarg, "always" ) == 0 ) { 518 ErrorHelpers::colors = ErrorHelpers::Colors::Always; 519 } else if ( strcmp( optarg, "never" ) == 0 ) { 520 ErrorHelpers::colors = ErrorHelpers::Colors::Never; 521 } else if ( strcmp( optarg, "auto" ) == 0 ) { 522 ErrorHelpers::colors = ErrorHelpers::Colors::Auto; 523 } // if 524 break; 514 525 case 'h': // help message 515 526 usage( argv ); // no return
Note: See TracChangeset
for help on using the changeset viewer.