summaryrefslogtreecommitdiffstats
path: root/git-amb/git-amb.in
diff options
context:
space:
mode:
Diffstat (limited to 'git-amb/git-amb.in')
-rwxr-xr-xgit-amb/git-amb.in37
1 files changed, 32 insertions, 5 deletions
diff --git a/git-amb/git-amb.in b/git-amb/git-amb.in
index 75a1c5b..6aab868 100755
--- a/git-amb/git-amb.in
+++ b/git-amb/git-amb.in
@@ -22,21 +22,48 @@
# Known to work and tested with
# - git 1.5.3.4
+unset CDPATH
+
+if test "x$(pwd)" = "x`pwd`" && test "y$(echo "foobar")" = "y`echo foobar`"
+then :;
+else
+ echo "$self: FATAL: This shell does not support POSIX sh \$() command substitution" >&2
+ exit 1
+fi
self="$(basename "$0")"
+bindir="$(cd "$(dirname "$0")" && pwd)"
+prefixdir="$(dirname "$bindir")"
case "$1" in
- -V|--version)
- echo "$self (@PACKAGE_NAME@) @PACKAGE_VERSION@"
- exit 0
- ;;
+ -V|--version)
+ echo "$self (@PACKAGE_NAME@) @PACKAGE_VERSION@"
+ exit 0
+ ;;
+ -h|--help)
+ for manpage in \
+ "${prefixdir}/share/man/man1/${self}.1.gz" \
+ "${prefixdir}/share/man/man1/${self}.1" \
+ "${prefixdir}/man/man1/${self}.1.gz" \
+ "${prefixdir}/man/man1/${self}.1" \
+ ;
+ do
+ if test -s "$manpage"
+ then
+ if man "$manpage" 2> /dev/null
+ then
+ exit 0
+ fi
+ fi
+ done
+ ;;
esac
USAGE="<command> [params...]"
LONG_USAGE="\
Build automake based git checkout in branch specific build and install trees.
-For more details, see the git-amb(1) man page."
+For more details, see the ${self}(1) man page."
. git-sh-setup
require_work_tree