aboutsummaryrefslogtreecommitdiffstats
path: root/sway/main.c
diff options
context:
space:
mode:
authorLibravatar Manuel Stoeckl <code@mstoeckl.com>2022-03-27 12:23:37 -0400
committerLibravatar Simon Ser <contact@emersion.fr>2022-03-29 08:42:17 +0200
commit8f036b6f788e45a36d3126a661913dd38008cc41 (patch)
treebd9890db3e2f140d71724297ca14af8749a720d2 /sway/main.c
parentbash-completion: localize variables (diff)
downloadsway-8f036b6f788e45a36d3126a661913dd38008cc41.tar.gz
sway-8f036b6f788e45a36d3126a661913dd38008cc41.tar.zst
sway-8f036b6f788e45a36d3126a661913dd38008cc41.zip
sway/main: move constants off the stack
This makes stack traces from gdb slightly easier to read.
Diffstat (limited to 'sway/main.c')
-rw-r--r--sway/main.c48
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,
240 _sway_vlog(convert_wlr_log_importance(importance), sway_fmt, args); 240 _sway_vlog(convert_wlr_log_importance(importance), sway_fmt, args);
241} 241}
242 242
243static const struct option long_options[] = {
244 {"help", no_argument, NULL, 'h'},
245 {"config", required_argument, NULL, 'c'},
246 {"validate", no_argument, NULL, 'C'},
247 {"debug", no_argument, NULL, 'd'},
248 {"version", no_argument, NULL, 'v'},
249 {"verbose", no_argument, NULL, 'V'},
250 {"get-socketpath", no_argument, NULL, 'p'},
251 {"unsupported-gpu", no_argument, NULL, 'u'},
252 {0, 0, 0, 0}
253};
254
255static const char usage[] =
256 "Usage: sway [options] [command]\n"
257 "\n"
258 " -h, --help Show help message and quit.\n"
259 " -c, --config <config> Specify a config file.\n"
260 " -C, --validate Check the validity of the config file, then exit.\n"
261 " -d, --debug Enables full logging, including debug information.\n"
262 " -v, --version Show the version number and quit.\n"
263 " -V, --verbose Enables more verbose logging.\n"
264 " --get-socketpath Gets the IPC socket path and prints it, then exits.\n"
265 "\n";
266
243int main(int argc, char **argv) { 267int main(int argc, char **argv) {
244 static bool verbose = false, debug = false, validate = false, allow_unsupported_gpu = false; 268 static bool verbose = false, debug = false, validate = false, allow_unsupported_gpu = false;
245 269
246 static const struct option long_options[] = {
247 {"help", no_argument, NULL, 'h'},
248 {"config", required_argument, NULL, 'c'},
249 {"validate", no_argument, NULL, 'C'},
250 {"debug", no_argument, NULL, 'd'},
251 {"version", no_argument, NULL, 'v'},
252 {"verbose", no_argument, NULL, 'V'},
253 {"get-socketpath", no_argument, NULL, 'p'},
254 {"unsupported-gpu", no_argument, NULL, 'u'},
255 {0, 0, 0, 0}
256 };
257
258 char *config_path = NULL; 270 char *config_path = NULL;
259 271
260 const char* usage =
261 "Usage: sway [options] [command]\n"
262 "\n"
263 " -h, --help Show help message and quit.\n"
264 " -c, --config <config> Specify a config file.\n"
265 " -C, --validate Check the validity of the config file, then exit.\n"
266 " -d, --debug Enables full logging, including debug information.\n"
267 " -v, --version Show the version number and quit.\n"
268 " -V, --verbose Enables more verbose logging.\n"
269 " --get-socketpath Gets the IPC socket path and prints it, then exits.\n"
270 "\n";
271
272 int c; 272 int c;
273 while (1) { 273 while (1) {
274 int option_index = 0; 274 int option_index = 0;