Clean up woption

1. Bravely use a real enum for has_arg, despite the warnings.

2. Use some C++11 initializers so we don't have to pass an int for this
   parameter.

No functional change expected here.
This commit is contained in:
ridiculousfish
2022-04-01 14:25:02 -07:00
parent ff72e3f154
commit a80e680125
30 changed files with 58 additions and 64 deletions

View File

@@ -303,7 +303,7 @@ static bool parse_flags(int argc, char **argv, bool *continuous_mode, bool *verb
{"help", no_argument, nullptr, 'h'},
{"version", no_argument, nullptr, 'v'},
{"verbose", no_argument, nullptr, 'V'},
{nullptr, 0, nullptr, 0}};
{}};
int opt;
bool error = false;
while (!error && (opt = getopt_long(argc, argv, short_opts, long_opts, nullptr)) != -1) {