summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2007-11-06 15:28:16 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2007-11-06 15:28:16 +0100
commit52854e095f8dcf6cba1d44005ccca2a7ccddd63f (patch)
treefd6188c6f8c5d7293336b4a82f4a4fa76dea9582
parent9721e2d12e61e20d0f809256d5af3a23f0ce72f5 (diff)
downloadndim-git-utils-52854e095f8dcf6cba1d44005ccca2a7ccddd63f.tar.gz
ndim-git-utils-52854e095f8dcf6cba1d44005ccca2a7ccddd63f.tar.xz
ndim-git-utils-52854e095f8dcf6cba1d44005ccca2a7ccddd63f.zip
Add $() check, let --help show man pagev1.9
-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