#!/bin/sh # Dual-licensed. Choose LICENSE.MIT or LICENSE.GPL. # Contributions to this file will only be accepted under the same license. # Designed to be sourced. case "$(basename "$0")" in git-ndim-sh|git-ndim-sh.in) echo "This script is not supposed to be executed." >&2 echo "Source it instead." >&2 exit 1 ;; esac 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 if test "x$(moo() { echo "meh"; }; moo)" = "xmeh"; then :; else echo "$self: FATAL: This shell does not support POSIX sh functions" >&2 exit 1 fi bindir="$(cd "$(dirname "$0")" && pwd)" prefixdir="$(dirname "$bindir")" case "$1" in -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