Use bools for CLI flags

This commit is contained in:
Simon Ser 2022-01-31 10:39:12 +01:00 committed by Kenny Levinsen
parent cd1ee0e172
commit 518e18a54b

View file

@ -241,7 +241,7 @@ static void handle_wlr_log(enum wlr_log_importance importance,
} }
int main(int argc, char **argv) { int main(int argc, char **argv) {
static int verbose = 0, debug = 0, validate = 0, allow_unsupported_gpu = 0; static bool verbose = false, debug = false, validate = false, allow_unsupported_gpu = false;
static const struct option long_options[] = { static const struct option long_options[] = {
{"help", no_argument, NULL, 'h'}, {"help", no_argument, NULL, 'h'},
@ -286,23 +286,23 @@ int main(int argc, char **argv) {
config_path = strdup(optarg); config_path = strdup(optarg);
break; break;
case 'C': // validate case 'C': // validate
validate = 1; validate = true;
break; break;
case 'd': // debug case 'd': // debug
debug = 1; debug = true;
break; break;
case 'D': // extended debug options case 'D': // extended debug options
enable_debug_flag(optarg); enable_debug_flag(optarg);
break; break;
case 'u': case 'u':
allow_unsupported_gpu = 1; allow_unsupported_gpu = true;
break; break;
case 'v': // version case 'v': // version
printf("sway version " SWAY_VERSION "\n"); printf("sway version " SWAY_VERSION "\n");
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
break; break;
case 'V': // verbose case 'V': // verbose
verbose = 1; verbose = true;
break; break;
case 'p': ; // --get-socketpath case 'p': ; // --get-socketpath
if (getenv("SWAYSOCK")) { if (getenv("SWAYSOCK")) {