@@ -24,12 +24,12 @@ int optind = 2;
2424
2525namespace scope {
2626
27- // / For macro processing
27+ // / Sentinel for options with no default value.
2828const char kNoDefaultArgument = 0 ;
2929
3030RecalibrationOptions ParseRecalibrationOptions (int argc, char **argv) {
31- // Define an enum for each valid flag (command-line entry), which maps it
32- // from the name to an integer
31+ // Each block below re-expands RECALIBRATE to derive a piece of getopt
32+ // wiring from the option table in options.hpp.
3333 enum class ClientOption {
3434#define SCOPE_CLI_OPTION (name, type, prop, defaultVal, converter, defaultArg, \
3535 ASSIGN , doc) \
@@ -38,8 +38,6 @@ RecalibrationOptions ParseRecalibrationOptions(int argc, char **argv) {
3838#undef SCOPE_CLI_OPTION
3939 };
4040
41- // Define an array of options, which defines the traits pertaining to each
42- // expected command-line entry
4341 static option long_options[] = {
4442#define SCOPE_CLI_OPTION (name, type, prop, defaultVal, converter, defaultArg, \
4543 ASSIGN , doc) \
@@ -50,15 +48,10 @@ RecalibrationOptions ParseRecalibrationOptions(int argc, char **argv) {
5048#undef SCOPE_CLI_OPTION
5149 {0 }};
5250
53- // Define our result, and iterator helpers
5451 RecalibrationOptions options;
5552 int index;
5653 int option;
5754
58- // Iterates through the list of command-line tokens and figures out
59- // what data to assign to which field in options. Note that the
60- // SCOPE_CLI_OPTION defines the conversion already between any
61- // particular parameter (as a string) to its actual type
6255 while ((option = getopt_long (argc, argv, " " , long_options, &index)) != -1 ) {
6356 switch (option) {
6457#define SCOPE_CLI_OPTION (name, type, prop, defaultVal, converter, defaultArg, \
0 commit comments