comparison sidinfo.c @ 322:5dfce66cc390

Reorder / clean up the commandline option indices.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 11 Jan 2020 22:37:02 +0200
parents 3bb2e0bdd1f0
children 4b99dff0958d
comparison
equal deleted inserted replaced
321:3bb2e0bdd1f0 322:5dfce66cc390
118 118
119 // Define option arguments 119 // Define option arguments
120 static const th_optarg optList[] = 120 static const th_optarg optList[] =
121 { 121 {
122 { 0, '?', "help", "Show this help", OPT_NONE }, 122 { 0, '?', "help", "Show this help", OPT_NONE },
123 { 10, 0, "license", "Print out this program's license agreement", OPT_NONE }, 123 { 1, 0, "license", "Print out this program's license agreement", OPT_NONE },
124 { 1, 'v', "verbose", "Be more verbose", OPT_NONE }, 124 { 2, 'v', "verbose", "Be more verbose", OPT_NONE },
125 125
126 { 2, 'p', "parsable", "Output in script-parsable format", OPT_NONE }, 126 { 3, 'p', "parsable", "Output in script-parsable format", OPT_NONE },
127 { 4, 'x', "hex", "Use hexadecimal values", OPT_NONE },
127 { 5, 'n', "noprefix", "Output without field name prefix", OPT_NONE }, 128 { 5, 'n', "noprefix", "Output without field name prefix", OPT_NONE },
128 { 6, 'l', "line", "Output in one line format, -l <field separator>", OPT_ARGREQ }, 129 { 6, 'l', "line", "Output in one line format, -l <field separator>", OPT_ARGREQ },
129 { 11, 'e', "escape", "Escape these characters in fields (see note)", OPT_ARGREQ }, 130 { 7, 'e', "escape", "Escape these characters in fields (see note)", OPT_ARGREQ },
130 { 3, 'f', "fields", "Show only specified field(s)", OPT_ARGREQ }, 131 { 8, 'f', "fields", "Show only specified field(s)", OPT_ARGREQ },
131 { 4, 'x', "hex", "Use hexadecimal values", OPT_NONE }, 132 { 9, 'F', "format", "Use given format string (see below)", OPT_ARGREQ },
132 { 7, 'F', "format", "Use given format string (see below)", OPT_ARGREQ }, 133 { 19, 'H', "hvsc", "Specify path to HVSC root directory", OPT_ARGREQ },
133 { 8, 'H', "hvsc", "Specify path to HVSC root directory", OPT_ARGREQ }, 134 { 11, 'S', "sldb", "Specify Songlengths.(txt|md5) file", OPT_ARGREQ },
134 { 9, 'S', "sldb", "Specify Songlengths.(txt|md5) file", OPT_ARGREQ }, 135 { 12, 'T', "stildb", "Specify STIL.txt file", OPT_ARGREQ },
135 { 13, 'T', "stildb", "Specify STIL.txt file", OPT_ARGREQ }, 136 { 13, 'R', "recurse", "Recurse into sub-directories", OPT_NONE },
136 { 12, 'R', "recurse", "Recurse into sub-directories", OPT_NONE },
137 }; 137 };
138 138
139 static const int optListN = sizeof(optList) / sizeof(optList[0]); 139 static const int optListN = sizeof(optList) / sizeof(optList[0]);
140 140
141 141
630 case 0: 630 case 0:
631 argShowHelp(); 631 argShowHelp();
632 exit(0); 632 exit(0);
633 break; 633 break;
634 634
635 case 10: 635 case 1:
636 sidutil_print_license(); 636 sidutil_print_license();
637 exit(0); 637 exit(0);
638 break; 638 break;
639 639
640 case 1: 640 case 2:
641 th_verbosity++; 641 th_verbosity++;
642 break; 642 break;
643 643
644 case 2: 644 case 3:
645 optParsable = TRUE; 645 optParsable = TRUE;
646 break; 646 break;
647 647
648 case 3: 648 case 4:
649 optHexadecimal = TRUE;
650 break;
651
652 case 5:
653 optFieldNamePrefix = FALSE;
654 break;
655
656 case 6:
657 optOneLineFieldSep = optArg;
658 break;
659
660 case 7:
661 optEscapeChars = optArg;
662 break;
663
664 case 8:
649 if (!argParsePSFields(&optFormat, optArg)) 665 if (!argParsePSFields(&optFormat, optArg))
650 return FALSE; 666 return FALSE;
651 break; 667 break;
652 668
653 case 4: 669 case 9:
654 optHexadecimal = TRUE;
655 break;
656
657 case 5:
658 optFieldNamePrefix = FALSE;
659 break;
660
661 case 6:
662 optOneLineFieldSep = optArg;
663 break;
664
665 case 7:
666 optFieldOutput = FALSE; 670 optFieldOutput = FALSE;
667 optParsable = FALSE;
668 if (!argParsePSFormatStr(&optFormat, optArg)) 671 if (!argParsePSFormatStr(&optFormat, optArg))
669 return FALSE; 672 return FALSE;
670 break; 673 break;
671 674
672 case 8: 675 case 10:
673 th_pstr_cpy(&setHVSCPath, optArg); 676 th_pstr_cpy(&setHVSCPath, optArg);
674 break; 677 break;
675 678
676 case 9: 679 case 11:
677 th_pstr_cpy(&setSLDBPath, optArg); 680 th_pstr_cpy(&setSLDBPath, optArg);
678 break; 681 break;
679 682
680 case 13: 683 case 12:
681 th_pstr_cpy(&setSTILDBPath, optArg); 684 th_pstr_cpy(&setSTILDBPath, optArg);
682 break; 685 break;
683 686
684 case 11: 687 case 13:
685 optEscapeChars = optArg;
686 break;
687
688 case 12:
689 optRecurseDirs = TRUE; 688 optRecurseDirs = TRUE;
690 break; 689 break;
691 690
692 default: 691 default:
693 THERR("Unknown option '%s'.\n", currArg); 692 THERR("Unknown option '%s'.\n", currArg);