aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2024-11-13 22:32:00 +0530
committerFurkan Sahin <furkan-dev@proton.me>2024-11-13 22:32:00 +0530
commitcc3ba349cbec3c01eac7ae5fb6f6286ed37e6200 (patch)
tree744514a574fd0bd8259efc497866c38e022d7225
parenta357835607f30981ad2c8e591cda7af43b7ace3e (diff)
commands/include: handle many files in single line
i3 supports including multiple files in a single line, whereas sway limits to single file per line.
-rw-r--r--sway/commands/include.c6
-rw-r--r--sway/sway.5.scd4
2 files changed, 5 insertions, 5 deletions
diff --git a/sway/commands/include.c b/sway/commands/include.c
index d4c14c35..e0d0c064 100644
--- a/sway/commands/include.c
+++ b/sway/commands/include.c
@@ -3,12 +3,12 @@
struct cmd_results *cmd_include(int argc, char **argv) {
struct cmd_results *error = NULL;
- if ((error = checkarg(argc, "include", EXPECTED_EQUAL_TO, 1))) {
+ if ((error = checkarg(argc, "include", EXPECTED_AT_LEAST, 1))) {
return error;
}
-
+ char *files = join_args(argv, argc);
// We don't care if the included config(s) fails to load.
- load_include_configs(argv[0], config, &config->swaynag_config_errors);
+ load_include_configs(files, config, &config->swaynag_config_errors);
return cmd_results_new(CMD_SUCCESS, NULL);
}
diff --git a/sway/sway.5.scd b/sway/sway.5.scd
index bb958ebf..50de552f 100644
--- a/sway/sway.5.scd
+++ b/sway/sway.5.scd
@@ -66,8 +66,8 @@ The following commands may only be used in the configuration file.
*default_orientation* horizontal|vertical|auto
Sets the default container layout for tiled containers.
-*include* <path>
- Includes another file from _path_. _path_ can be either a full path or a
+*include* <paths...>
+ Include files from _paths_. _paths_ can include either a full path or a
path relative to the parent config, and expands shell syntax (see
*wordexp*(3) for details). The same include file can only be included once;
subsequent attempts will be ignored.