Add command line parsing

Closes #6
This commit is contained in:
Drew DeVault 2015-08-20 08:37:09 -04:00
parent 927ef0a5ec
commit 579fe70ed9
5 changed files with 86 additions and 6 deletions

View file

@ -144,10 +144,15 @@ _continue:
return test;
}
bool load_config(void) {
bool load_config(const char *file) {
sway_log(L_INFO, "Loading config");
char *path = get_config_path();
char *path;
if (file != NULL) {
path = strdup(file);
} else {
path = get_config_path();
}
if (path == NULL) {
sway_log(L_ERROR, "Unable to find a config file!");