#! /bin/sh # Copyright (C) 2009-2010 Uwe Kleine-König # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. set -e UG_VERSION="20100908.0" export UG_VERSION if test "${UG_EXEC_PATH:+set}" != "set"; then UG_EXEC_PATH='@@UG_EXEC_PATH@@' export UG_EXEC_PATH fi UG_OPTIONS_SPEC="\ ug --version ug [-h|--help] ug [--debug] ... -- debug print much unreadable and unusable output h,help! show this help version! show version number and exit " . "$UG_EXEC_PATH/uglib.sh" ## help ## {{{1 help() { echo "Use the source, Luke" } ## version ## {{{1 version() { echo "$UG_VERSION" } # }}} while true; do case "$1" in --help) # This isn't reached as # git rev-parse --parseopt catches -h,--help help exit 0 ;; --version) version exit 0 ;; --debug) shopt="-x" ;; --) break ;; esac shift done GIT_DIR="$(git rev-parse --git-dir)" export GIT_DIR assert test "x$1" = "x--" shift ug_cmd="$1"; shift case "$ug_cmd" in "") help exit 1 ;; help) help ;; version) version ;; *) if test -x "$UG_EXEC_PATH/ug-$ug_cmd"; then exec sh $shopt "$UG_EXEC_PATH/ug-$ug_cmd" "$@" else die "Unknown command: $ug_cmd" fi;; esac