feat: support -c option to specified config file

This commit is contained in:
DreamMaoMao
2025-12-03 16:12:05 +08:00
parent a2902a469b
commit 1ffdc1ef38
3 changed files with 22 additions and 4 deletions

View File

@@ -852,6 +852,7 @@ struct dvec2 *baked_points_focus;
static struct wl_event_source *hide_source;
static bool cursor_hidden = false;
static bool tag_combo = false;
static const char *cli_config_path = NULL;
static KeyMode keymode = {
.mode = {'d', 'e', 'f', 'a', 'u', 'l', 't', '\0'},
.isdefault = true,
@@ -5908,13 +5909,15 @@ int main(int argc, char *argv[]) {
char *startup_cmd = NULL;
int c;
while ((c = getopt(argc, argv, "s:hdv")) != -1) {
while ((c = getopt(argc, argv, "s:c:hdv")) != -1) {
if (c == 's')
startup_cmd = optarg;
else if (c == 'd')
log_level = WLR_DEBUG;
else if (c == 'v')
die("mango " VERSION);
else if (c == 'c')
cli_config_path = optarg;
else
goto usage;
}