diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/sway/commands.c b/sway/commands.c index b09a04c7..205406ad 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -465,34 +465,6 @@ struct cmd_results *config_commands_command(char *exec) { | |||
465 | goto cleanup; | 465 | goto cleanup; |
466 | } | 466 | } |
467 | 467 | ||
468 | enum command_context context = 0; | ||
469 | |||
470 | struct { | ||
471 | char *name; | ||
472 | enum command_context context; | ||
473 | } context_names[] = { | ||
474 | { "config", CONTEXT_CONFIG }, | ||
475 | { "binding", CONTEXT_BINDING }, | ||
476 | { "ipc", CONTEXT_IPC }, | ||
477 | { "criteria", CONTEXT_CRITERIA }, | ||
478 | { "all", CONTEXT_ALL }, | ||
479 | }; | ||
480 | |||
481 | for (int i = 1; i < argc; ++i) { | ||
482 | size_t j; | ||
483 | for (j = 0; j < sizeof(context_names) / sizeof(context_names[0]); ++j) { | ||
484 | if (strcmp(context_names[j].name, argv[i]) == 0) { | ||
485 | break; | ||
486 | } | ||
487 | } | ||
488 | if (j == sizeof(context_names) / sizeof(context_names[0])) { | ||
489 | results = cmd_results_new(CMD_INVALID, | ||
490 | "Invalid command context %s", argv[i]); | ||
491 | goto cleanup; | ||
492 | } | ||
493 | context |= context_names[j].context; | ||
494 | } | ||
495 | |||
496 | results = cmd_results_new(CMD_SUCCESS, NULL); | 468 | results = cmd_results_new(CMD_SUCCESS, NULL); |
497 | 469 | ||
498 | cleanup: | 470 | cleanup: |