main: fix error message for missing argument

* src/getargs.c (getargs): Don't display any argv other that argv[0]
when reporting a missing argument.
* tests/bison.in: Neutralize path differences in stderr.
* tests/input.at (Invalid number of arguments): New.
This commit is contained in:
Akim Demaille
2018-10-04 21:38:32 +02:00
parent f84a8e96d1
commit 26859f6d61
3 changed files with 33 additions and 2 deletions

View File

@@ -25,9 +25,15 @@ abs_top_builddir='@abs_top_builddir@'
BISON_PKGDATADIR=$abs_top_srcdir/data
export BISON_PKGDATADIR
$PREBISON "$abs_top_builddir/src/bison" ${1+"$@"}
stderr=tmp-bison.$$
$PREBISON "$abs_top_builddir/src/bison" ${1+"$@"} 2>"$stderr"
status=$?
# Neutralize path differences in error messages so that check and
# installcheck behave the same way.
sed -e "s,$abs_top_builddir/src/,,g" <"$stderr" >&2
rm -f "$stderr"
# As a special dark magic, if we are actually using this wrapper to
# compile Bison's src/parse-gram.y, post-process the synclines to
# avoid dependencies on the user's set up (srcdir vs. builddir).