Add command line option -C to specify config directory

Also expand usage message to explain what each option means
This commit is contained in:
Johan Malm 2022-04-22 17:00:36 +01:00
parent d0b9680d00
commit edc5338af4
8 changed files with 47 additions and 27 deletions

View file

@ -10,7 +10,6 @@
#include <strings.h>
#include <wlr/util/log.h>
#include "common/buf.h"
#include "common/dir.h"
#include "common/font.h"
#include "common/nodename.h"
#include "common/string-helpers.h"
@ -295,10 +294,10 @@ parse_xml(const char *filename, struct server *server)
struct buf b;
static char menuxml[4096] = { 0 };
if (!strlen(config_dir())) {
if (!rc.config_dir) {
return;
}
snprintf(menuxml, sizeof(menuxml), "%s/%s", config_dir(), filename);
snprintf(menuxml, sizeof(menuxml), "%s/%s", rc.config_dir, filename);
stream = fopen(menuxml, "r");
if (!stream) {