From fd21d22a6ff6cc7e3a3c1ad9e223f840c1c65296 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 18 Nov 2008 22:17:32 +0100 Subject: off: Die when encountering an unknown option to prevent typos --- etc/functions/off | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'etc/functions/off') 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 } -- cgit v1.2.3