Commit 1af9e045 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

By default linux::getopt(3) mangles the argv order, such that

	varnishadm -n bla param.set foo -bar

gets interpreted as

	varnishadm -n bla -bar param.set foo

This is counterintuitive and invites random script breaking if people
don't know they have to add an ornamental '--' in front of the CLI command
in Linux systems.

This commit makes Linux work the same way as every other POSIX system.

Fixes	#1496
parent 2fbac3f2
......@@ -439,7 +439,15 @@ main(int argc, char * const *argv)
const char *n_arg = NULL;
int opt, sock;
while ((opt = getopt(argc, argv, "n:S:T:t:")) != -1) {
/*
* By default linux::getopt(3) mangles the argv order, such that
* varnishadm -n bla param.set foo -bar
* gets interpreted as
* varnishadm -n bla -bar param.set foo
* The '+' stops that from happening
* See #1496
*/
while ((opt = getopt(argc, argv, "+n:S:T:t:")) != -1) {
switch (opt) {
case 'n':
n_arg = optarg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment