to be merged: replace -S by --server

This commit is contained in:
Frederic Lecaille 2026-05-18 11:07:24 +02:00
parent fd3f99e348
commit 1409eff884

View file

@ -38,7 +38,7 @@ static void hld_usage(char *name, int argc, int line)
" -C dump the configuration and exit\n"
" -H \"foo:bar\" add this header name and value\n"
" -I use HEAD instead of GET\n"
" -S set server options as defined for \"server\" haproxy keyword\n"
" -server set server options as defined for \"server\" haproxy keyword\n"
" -v shows version\n"
" --show-status-codes show HTTP status codes distribution\n"
" --traces enable the traces for all the HTTP protocols\n"
@ -273,6 +273,15 @@ void haproxy_init_args(int argc, char **argv)
else if (strcmp(opt, "show-status-codes") == 0) {
arg_hscd = 1;
}
else if (strcmp(opt, "server") == 0) {
argv++, argc--;
if ((argc <= 0 || **argv == '-'))
hld_usage(progname, argc, __LINE__);
opt = *argv;
ssl_opts = strdup(opt);
}
else
hld_usage(progname, argc, __LINE__);
}
@ -357,18 +366,6 @@ void haproxy_init_args(int argc, char **argv)
hbuf_str_append(&gbuf, *argv);
}
else if (*opt == 'S') {
opt++;
if (!*opt) {
argv++, argc--;
if ((argc <= 0 || **argv == '-'))
hld_usage(progname, argc, __LINE__);
opt = *argv;
}
ssl_opts = strdup(opt);
}
else if (*opt == 'v') {
/* empty option */
if (*(opt + 1))