aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-12-06 12:10:24 -0500
committerGitHub <noreply@github.com>2017-12-06 12:10:24 -0500
commitab36a5a4d73ddb026c9b1d416c1e7388d63958ea (patch)
tree01f75e94a5e4a2210c01c11b90225492344b624c /sway/commands
parenta89d1333f1de52e788ccab8899ce79ede5d3192e (diff)
parent9aeda824779d3174db01b6445fa349def031a035 (diff)
downloadsway-ab36a5a4d73ddb026c9b1d416c1e7388d63958ea.tar.xz
Merge pull request #1501 from emersion/command-include
Add include command
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/include.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sway/commands/include.c b/sway/commands/include.c
new file mode 100644
index 00000000..1ba9a10d
--- /dev/null
+++ b/sway/commands/include.c
@@ -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);
+}