diff options
author | Thomas Bächler <thomas@archlinux.org> | 2011-06-26 23:18:44 +0200 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2011-06-26 23:18:44 +0200 |
commit | 027ddb69122af89c89aa50906eec045f349c9490 (patch) | |
tree | f8350d984b5c3feee85f9613de4314d49d54aadb /mkinitcpio | |
parent | 60c079c11435e9e120cc6ebb991071e321b20639 (diff) | |
parent | f58be6cc8d802c4c48edd594aab41408df30e954 (diff) | |
download | mkinitcpio-027ddb69122af89c89aa50906eec045f349c9490.tar.gz mkinitcpio-027ddb69122af89c89aa50906eec045f349c9490.tar.xz |
Merge branch 'master' of https://github.com/seblu/arch-mkinitcpio into working
Diffstat (limited to 'mkinitcpio')
-rwxr-xr-x | mkinitcpio | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -118,8 +118,16 @@ 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}" + if [[ $(type -t help) != function ]]; then + error "No help for hook ${OPTARG}" + exit 1 + fi + echo "Help for hook '${OPTARG}':" help exit 0 ;; L) msg "Available hooks" @@ -129,9 +137,9 @@ while getopts ':c:k:sb:g:p:m:nvH:LMhS:t:z:' arg; do M) SHOW_AUTOMODS=1 ;; t) TMPDIR=$OPTARG ;; z) optcompress=$OPTARG ;; - :) echo "error: option requires an argument -- '$OPTARG'" >&2 + :) error "option requires an argument -- '$OPTARG'" >&2 exit 1 ;; - \?) echo "error: invalid option -- '$OPTARG'" >&2 + \?) error "invalid option -- '$OPTARG'" >&2 exit 1 ;; esac done |