diff options
author | Manuel Stoeckl <code@mstoeckl.com> | 2022-03-27 12:23:37 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-03-29 08:42:17 +0200 |
commit | 8f036b6f788e45a36d3126a661913dd38008cc41 (patch) | |
tree | bd9890db3e2f140d71724297ca14af8749a720d2 /sway | |
parent | fb3330c1fbcf550118d774900f79756a596d7c3b (diff) |
sway/main: move constants off the stack
This makes stack traces from gdb slightly easier to read.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/main.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/sway/main.c b/sway/main.c index cbe6e603..78974e22 100644 --- a/sway/main.c +++ b/sway/main.c @@ -240,35 +240,35 @@ static void handle_wlr_log(enum wlr_log_importance importance, _sway_vlog(convert_wlr_log_importance(importance), sway_fmt, args); } +static const struct option long_options[] = { + {"help", no_argument, NULL, 'h'}, + {"config", required_argument, NULL, 'c'}, + {"validate", no_argument, NULL, 'C'}, + {"debug", no_argument, NULL, 'd'}, + {"version", no_argument, NULL, 'v'}, + {"verbose", no_argument, NULL, 'V'}, + {"get-socketpath", no_argument, NULL, 'p'}, + {"unsupported-gpu", no_argument, NULL, 'u'}, + {0, 0, 0, 0} +}; + +static const char usage[] = + "Usage: sway [options] [command]\n" + "\n" + " -h, --help Show help message and quit.\n" + " -c, --config <config> Specify a config file.\n" + " -C, --validate Check the validity of the config file, then exit.\n" + " -d, --debug Enables full logging, including debug information.\n" + " -v, --version Show the version number and quit.\n" + " -V, --verbose Enables more verbose logging.\n" + " --get-socketpath Gets the IPC socket path and prints it, then exits.\n" + "\n"; + int main(int argc, char **argv) { static bool verbose = false, debug = false, validate = false, allow_unsupported_gpu = false; - static const struct option long_options[] = { - {"help", no_argument, NULL, 'h'}, - {"config", required_argument, NULL, 'c'}, - {"validate", no_argument, NULL, 'C'}, - {"debug", no_argument, NULL, 'd'}, - {"version", no_argument, NULL, 'v'}, - {"verbose", no_argument, NULL, 'V'}, - {"get-socketpath", no_argument, NULL, 'p'}, - {"unsupported-gpu", no_argument, NULL, 'u'}, - {0, 0, 0, 0} - }; - char *config_path = NULL; - const char* usage = - "Usage: sway [options] [command]\n" - "\n" - " -h, --help Show help message and quit.\n" - " -c, --config <config> Specify a config file.\n" - " -C, --validate Check the validity of the config file, then exit.\n" - " -d, --debug Enables full logging, including debug information.\n" - " -v, --version Show the version number and quit.\n" - " -V, --verbose Enables more verbose logging.\n" - " --get-socketpath Gets the IPC socket path and prints it, then exits.\n" - "\n"; - int c; while (1) { int option_index = 0; |