commit:     7d68839e9ea89b0a92aef69a9b4fd298554bb9b1
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 12 18:01:51 2016 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Jul 25 20:36:44 2016 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=7d68839e

tmpfiles: Make unrecognized options fatal

This is part of #83.

 sh/tmpfiles.sh.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in
index 43442d7..f711b1d 100644
--- a/sh/tmpfiles.sh.in
+++ b/sh/tmpfiles.sh.in
@@ -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

Reply via email to