summaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-08-20 08:37:09 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-08-20 08:37:24 -0400
commit579fe70ed92ce65d5a761ebdbb6c458b5f919687 (patch)
treea56ab8990f003d4408f1ef71d35c425a3545aec2 /sway/config.c
parentMerge branch 'master' of https://github.com/SirCmpwn/sway (diff)
downloadsway-579fe70ed92ce65d5a761ebdbb6c458b5f919687.tar.gz
sway-579fe70ed92ce65d5a761ebdbb6c458b5f919687.tar.zst
sway-579fe70ed92ce65d5a761ebdbb6c458b5f919687.zip
Add command line parsing
Closes #6
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sway/config.c b/sway/config.c
index 94bc2abb..9f65e8a2 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -144,10 +144,15 @@ _continue:
144 return test; 144 return test;
145} 145}
146 146
147bool load_config(void) { 147bool load_config(const char *file) {
148 sway_log(L_INFO, "Loading config"); 148 sway_log(L_INFO, "Loading config");
149 149
150 char *path = get_config_path(); 150 char *path;
151 if (file != NULL) {
152 path = strdup(file);
153 } else {
154 path = get_config_path();
155 }
151 156
152 if (path == NULL) { 157 if (path == NULL) {
153 sway_log(L_ERROR, "Unable to find a config file!"); 158 sway_log(L_ERROR, "Unable to find a config file!");