Refactor cmd_output to use config_subcommand

This commit is contained in:
Brian Ashworth 2018-06-02 21:33:16 -04:00
parent ebe0b668c9
commit 5ea4a4d3ee
12 changed files with 371 additions and 267 deletions

View file

@ -0,0 +1,13 @@
#include "sway/commands.h"
#include "sway/config.h"
struct cmd_results *output_cmd_disable(int argc, char **argv) {
if (!config->handler_context.output_config) {
return cmd_results_new(CMD_FAILURE, "output", "Missing output config");
}
config->handler_context.output_config->enabled = 0;
config->handler_context.leftovers.argc = argc;
config->handler_context.leftovers.argv = argv;
return NULL;
}