The main objective is to remove the need to worry about option value assignment. Because of the way getopt works, we need to assign a number to each option, and later match the return value of getopt in a big switch. We have to make sure to not assign the same number to two options, and we have to carefully make sure the same number is used in two different places (once in the options table, once in the switch). And that is just annoying.
With this commit everything is in one place, and the compiler will yell at us if we assigned duplicated numbers.
Maybe this can also be a stepping stone for unifying command line options parsing and config file parsing.
The main objective is to remove the need to worry about option value assignment. Because of the way getopt works, we need to assign a number to each option, and later match the return value of getopt in a big switch. We have to make sure to not assign the same number to two options, and we have to carefully make sure the same number is used in two different places (once in the options table, once in the switch). And that is just annoying.
With this commit everything is in one place, and the compiler will yell at us if we assigned duplicated numbers.
Maybe this can also be a stepping stone for unifying command line options parsing and config file parsing.