Commit 7179b965 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Tempt fate and try to make getopt() error strings part of our tests,

in order to have less ambiguous error messages.
parent b7588942
......@@ -530,12 +530,9 @@ main(int argc, char * const *argv)
do {
switch (o) {
case '?':
if (optopt == '?') {
if (optopt == '?')
usage();
exit(1);
}
ARGV_ERR("Option '%c' unknown.\n",
optopt);
exit(2);
case 'V':
case 'x':
ARGV_ERR("-%c must be the first argument\n", o);
......
......@@ -11,7 +11,10 @@ shell -err -expect {-V must be the first argument} "varnishd -d -V foo "
shell -err -expect {Too many arguments for -x} "varnishd -x foo bar"
shell -err -expect {Invalid -x argument} "varnishd -x foo "
shell -err -expect {Option 'A' unknown.} "varnishd -A "
# This one is tricky, the getopt message on stderr is not standardized.
shell -err -expect {option --} "varnishd -A "
shell -err -expect {Usage: varnishd [options]} "varnishd -? "
shell -err -expect {Too many arguments} "varnishd foo "
......
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