diff options
author | Sebastien Luttringer <seblu@seblu.net> | 2011-06-18 06:56:55 +0200 |
---|---|---|
committer | Sebastien Luttringer <seblu@seblu.net> | 2011-06-26 23:15:56 +0200 |
commit | 3a65dbdaf17ff26691559fd224e66b2fbe3eee7c (patch) | |
tree | f1c1eee17c3b431d05c6527ccc03930da2224dfe | |
parent | b130e5d9f622c05863a889052d7bf9eac5c0af58 (diff) | |
download | mkinitcpio-3a65dbdaf17ff26691559fd224e66b2fbe3eee7c.tar.gz mkinitcpio-3a65dbdaf17ff26691559fd224e66b2fbe3eee7c.tar.xz |
Fix printing of bash usage when asking for a bad hook
before:
mkinitcpio -H sex
/sbin/mkinitcpio: line 105: /lib/initcpio/install/sex: No such file or directory
Help for hook 'sex':
GNU bash, version 4.2.10(2)-release (x86_64-unknown-linux-gnu)
These shell commands are defined internally. Type `help' to see this list.
after:
mkinitcpio -H sex
==> ERROR: No hook sex
Signed-off-by: Sebastien Luttringer <seblu@seblu.net>
-rwxr-xr-x | mkinitcpio | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -118,8 +118,12 @@ while getopts ':c:k:sb:g:p:m:nvH:LMhS:t:z:' arg; do IFS=${OLDIFS} unset OLDIFS ;; - H) . "${INSTDIR}/${OPTARG}"; - msg "Help for hook '${OPTARG}'" + H) if [[ ! -r "${INSTDIR}/${OPTARG}" ]]; then + error "No hook ${OPTARG}" + exit 1 + fi + . "${INSTDIR}/${OPTARG}" + echo "Help for hook '${OPTARG}':" help exit 0 ;; L) msg "Available hooks" |