diff options
author | Stephan Beyer <s-beyer@gmx.net> | 2008-07-13 15:36:15 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-13 14:12:48 -0700 |
commit | 1b1dd23f2d6a707b7077cdf6bc6d4055bd0bfb7d (patch) | |
tree | 6eb5a6d6bd6e5a6db54f1a43ab7931a196f4f814 /git-sh-setup.sh | |
parent | d492b31cafe9aa5ce001b1d48815f4c0bb40d01a (diff) | |
download | git-1b1dd23f2d6a707b7077cdf6bc6d4055bd0bfb7d.tar.gz |
Make usage strings dash-less
When you misuse a git command, you are shown the usage string.
But this is currently shown in the dashed form. So if you just
copy what you see, it will not work, when the dashed form
is no longer supported.
This patch makes git commands show the dash-less version.
For shell scripts that do not specify OPTIONS_SPEC, git-sh-setup.sh
generates a dash-less usage string now.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-sh-setup.sh')
-rwxr-xr-x | git-sh-setup.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 9cceb21a82..dbdf209ec0 100755 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -32,15 +32,16 @@ if test -n "$OPTIONS_SPEC"; then echo exit $? )" else + dashless=$(basename "$0" | sed -e 's/-/ /') usage() { - die "Usage: $0 $USAGE" + die "Usage: $dashless $USAGE" } if [ -z "$LONG_USAGE" ] then - LONG_USAGE="Usage: $0 $USAGE" + LONG_USAGE="Usage: $dashless $USAGE" else - LONG_USAGE="Usage: $0 $USAGE + LONG_USAGE="Usage: $dashless $USAGE $LONG_USAGE" fi |