Changes in src/main.cc [b4f8808:49d3128]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
rb4f8808 r49d3128 407 407 408 408 409 static const char optstring[] = ": hlLmNnpP:S:twW: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[] = { 432 "print help message", // -h 433 "generate libcfa.c", // -l 434 "generate line marks", // -L 435 "do not replace main", // -m 436 "do not generate line marks", // -N 437 "do not read prelude", // -n 433 "diagnostic color: never, always, or auto.", // -c 434 "wait for gdb to attach", // -g 435 "print help message", // -h 436 "generate libcfa.c", // -l 437 "generate line marks", // -L 438 "do not replace main", // -m 439 "do not generate line marks", // -N 440 "do not read prelude", // -n 438 441 "generate prototypes for prelude functions", // -p 439 "print", 442 "print", // -P 440 443 "<directory> prelude directory for debug/nodebug", // no flag 441 444 "<option-list> enable profiling information:\n counters,heap,time,all,none", // -S 442 "building cfa standard lib", // -t 443 "wait for gdb to attach", // -g 444 "", // -w 445 "", // -W 446 "", // -D 445 "building cfa standard lib", // -t 446 "", // -w 447 "", // -W 448 "", // -D 447 449 }; // description 448 450 … … 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.