diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-18 22:17:32 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-18 22:17:32 +0100 |
commit | fd21d22a6ff6cc7e3a3c1ad9e223f840c1c65296 (patch) | |
tree | 85c1830f473c7b02453a5db32d87da81c1283993 | |
parent | 910756e86426e90b9e48a52c4f619ae3556f3b55 (diff) |
off: Die when encountering an unknown option to prevent typos
-rw-r--r-- | etc/functions/off | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/etc/functions/off b/etc/functions/off index 7ecaec9..fdab3d6 100644 --- a/etc/functions/off +++ b/etc/functions/off @@ -1,5 +1,5 @@ ## vim:ft=zsh -autoload warn +autoload warn fdie typeset filesystem line IFS=$'\n' typeset -a filesystems typeset tune2fs @@ -14,6 +14,7 @@ while [[ $1 == -* ]] { -n) simulate=1 ;; -r) reboot=1 ;; --force) force=1 ;; + *) fdie "Unrecognized option: $1"; return 1 ;; esac shift } |