Add include command

This commit is contained in:
emersion 2017-12-05 18:47:57 +01:00
parent 3fe64482bb
commit 9aeda82477
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 106 additions and 0 deletions

15
sway/commands/include.c Normal file
View file

@ -0,0 +1,15 @@
#include "sway/commands.h"
#include "sway/config.h"
struct cmd_results *cmd_include(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "include", EXPECTED_EQUAL_TO, 1))) {
return error;
}
if (!load_include_configs(argv[0], config)) {
return cmd_results_new(CMD_INVALID, "include", "Failed to include sub configuration file: %s", argv[0]);
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}