diff options
Diffstat (limited to 'jh.sh.in')
-rw-r--r-- | jh.sh.in | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/jh.sh.in b/jh.sh.in new file mode 100644 index 0000000..0d0b9f6 --- /dev/null +++ b/jh.sh.in @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright © 2013 Luke Shumaker <lukeshu@sbcglobal.net> +# This work is free. You can redistribute it and/or modify it under the +# terms of the Do What The Fuck You Want To Public License, Version 2, +# as published by Sam Hocevar. See the COPYING file for more details. + +if [[ -z $JH_PATH ]]; then + export JH_PATH=@jh-bindir@ +fi + +if [[ -z $jh_short ]]; then + export jh_short=${0##*/} + export PATH="$JH_PATH:$PATH" +fi + +main() { + if [[ $# < 1 ]]; then + jh-help >>/dev/stderr + return 1; + fi + cmd=$1 + shift + + if [[ -x "$(which "jh-$cmd" 2>/dev/null)" ]]; then + "jh-$cmd" "$@" + return $? + else + echo "$jh_short: Cannot find command '$cmd'" >> /dev/stderr + fi +} + +main "$@" |