2011-06-08 Stefano Lattarini <stefano.lattarini@gmail.com>
+ py-compile: complain on unrecognized options
+ * lib/py-compile: Complain on unrecognized options. Don't be too
+ lax in matching `--help' and `--version' options.
+ * tests/py-compile-usage.test: Extend accordingly.
+ * NEWS: Update.
+
+2011-06-08 Stefano Lattarini <stefano.lattarini@gmail.com>
+
py-compile: normalize error and help messages
* lib/py-compile: Now error messages do not begin with a capital
letter, nor end with a period, as per GNU standards. Prepend the
is obsoleted by `xz' and `dist-xz' due to upstream changes.
- The py-compile script now accepts empty arguments passed to the options
- `--destdir' and `--basedir'.
+ `--destdir' and `--basedir', and complains about unrecognized options.
Bugs fixed in 1.11.0a:
fi
shift
;;
- -h|--h*)
+ -h|--help)
cat <<\EOF
Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..."
EOF
exit $?
;;
- -v|--v*)
+ -v|--version)
echo "$me $scriptversion"
exit $?
;;
+ -*)
+ usage_error "unrecognized option '$1'"
+ ;;
*)
files="$files $1"
;;
LC_ALL=C $EGREP "^py-compile $year-$month-$day\.$hour" stdout
test `wc -l <stdout` -eq 1
+# Unknown option.
+for opt in -b -d --foo; do
+ ./py-compile $opt 2>stderr && { cat stderr >&2; Exit 1; }
+ cat stderr >&2
+ grep "^py-compile: unrecognized option ['\`]$opt'" stderr
+ grep "^Try [\`']py-compile --help' for more information" stderr
+done
+
# Missing option argument.
for opt in --basedir --destdir; do