diff --git a/src/haproxy.c b/src/haproxy.c index 90bbb95a0..217247d6d 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -416,7 +416,7 @@ void usage(char *name) fprintf(stderr, "Usage : %s [-f ]* [ -vdV" "D ] [ -n ] [ -N ]\n" - " [ -p ] [ -m ] [ -C ]\n" + " [ -p ] [ -m ] [ -C ] [-- *]\n" " -v displays version ; -vv shows known build options.\n" " -d enters debug mode ; -db only disables background mode.\n" " -dM[] poisons memory with (defaults to 0x50)\n" @@ -702,6 +702,21 @@ void init(int argc, char **argv) nb_oldpids++; } } + else if (flag[0] == '-' && flag[1] == 0) { /* "--" */ + /* now that's a cfgfile list */ + argv++; argc--; + while (argc > 0) { + wl = (struct wordlist *)calloc(1, sizeof(*wl)); + if (!wl) { + Alert("Cannot load configuration file %s : out of memory.\n", *argv); + exit(1); + } + wl->s = *argv; + LIST_ADDQ(&cfg_cfgfiles, &wl->list); + argv++; argc--; + } + break; + } else { /* >=2 args */ argv++; argc--; if (argc == 0)