// Hack: boost::program_options doesn't support repeated "-vv" // and "-vvv" syntax, it also doesn't support omitting the // value of a paremeter, both causes validation failure. It's // not worthwhile to write a custom validator just for exactly // a single special case. Just change argv[] to avoid them. // This must be the first parseCommandLineArguments() to call // in main(). for (int i = 0; i < argc; i++) { const char* arg = argv[i]; if (strcmp(arg, "--verbose") == 0) { argv[i] = "--verbose=1"; } if (strcmp(arg, "-v") == 0) { argv[i] = "--verbose=1"; } if (strcmp(arg, "-vv") == 0) { argv[i] = "--verbose=2"; } else if (strcmp(arg, "-vvv") == 0) { argv[i] = "--verbose=3"; } }
https://misskey-taube.s3.eu-central-1.wasabisys.com/files/8cf9a1fc-7c81-4c51-b6de-3fbe08517989.webp