tmpfiles: Make unrecognized options fatal

This is part of #83.
This commit is contained in:
Mike Gilbert 2016-03-12 13:01:51 -05:00 committed by William Hubbs
parent 5341a925c1
commit 7d68839e9e

View File

@ -33,6 +33,11 @@ warninvalid() {
error=$(( error+1 ))
} >&2
invalid_option() {
printf "tmpfiles: invalid option '%s'\n" "$1" >&2
exit 1
}
dryrun_or_real() {
local dryrun=
[ $DRYRUN -eq 1 ] && dryrun=echo
@ -299,6 +304,7 @@ while [ $# -gt 0 ]; do
--dryrun|--dry-run) DRYRUN=1 ;;
--exclude-prefix=*) EXCLUDE="${EXCLUDE}${1##--exclude-prefix=} " ;;
--prefix=*) PREFIX="${PREFIX}${1##--prefix=} " ;;
-*) invalid_option "$1" ;;
esac
shift
done