From: freku045@student.liu.se
To: git@vger.kernel.org
Cc: Fredrik Kuivinen <freku045@student.liu.se>
Subject: [PATCH 4/25] git-cherry: Print the usage message if we get an unknown option.
Date: Sat, 10 Dec 2005 20:37:57 +0100 [thread overview]
Message-ID: <11342434771080-git-send-email-freku045@student.liu.se> (raw)
In-Reply-To: <1134243476675-git-send-email-freku045@student.liu.se>
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
---
git-cherry.sh | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
10b829123619b4b3c398398726c830db87f7525a
diff --git a/git-cherry.sh b/git-cherry.sh
index 867522b..c21cf65 100755
--- a/git-cherry.sh
+++ b/git-cherry.sh
@@ -5,7 +5,8 @@
. git-sh-setup
-usage="usage: $0 "'[-v] <upstream> [<head>]
+usage () {
+ die "usage: $0 "'[-v] <upstream> [<head>]
__*__*__*__*__> <upstream>
/
@@ -18,8 +19,19 @@ compared against the change each commit
it is shown on the standard output with prefix "+". Otherwise
it is shown with prefix "-".
'
+}
-case "$1" in -v) verbose=t; shift ;; esac
+while [ "$#" != "0" ]; do
+ case "$1" in
+ "-v")
+ verbose=t;
+ shift
+ ;;
+ -*)
+ usage
+ ;;
+ esac
+done
case "$#,$1" in
1,*..*)
@@ -35,7 +47,7 @@ case "$#" in
2) upstream=`git-rev-parse --verify "$1"` &&
ours=`git-rev-parse --verify "$2"` || exit
;;
-*) echo >&2 "$usage"; exit 1 ;;
+*) usage ;;
esac
# Note that these list commits in reverse order;
--
0.99.9.GIT
next prev parent reply other threads:[~2005-12-10 19:38 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-10 19:37 [PATCH 0/25] Usage message clean-up freku045
2005-12-10 19:37 ` [PATCH 1/25] git-bisect: Use $0 instead of program name in usage message freku045
2005-12-10 19:37 ` freku045 [this message]
2005-12-10 19:37 ` [PATCH 7/25] git-count-objects: Die with usage message if we are invoked incorrectly freku045
2005-12-11 4:22 ` Junio C Hamano
2005-12-10 19:37 ` [PATCH 6/25] git-commit: Use $0 instead of program name in usage message freku045
2005-12-10 19:37 ` [PATCH 5/25] git-clone: " freku045
2005-12-10 19:37 ` [PATCH 8/25] git-fetch: Print usage message if we get an unrecognized option freku045
2005-12-10 19:37 ` [PATCH 9/25] git-format-patch: Use the 'die'-function where appropriate freku045
2005-12-10 19:37 ` [PATCH 2/25] git-branch: Use $0 instead of program name in usage message freku045
2005-12-10 19:37 ` [PATCH 3/25] git-checkout: " freku045
2005-12-10 19:37 ` [PATCH 10/25] git-grep: Print usage message on '-h' and '--help' freku045
2005-12-10 19:37 ` [PATCH 16/25] git-push: Clean up usage message freku045
2005-12-10 19:37 ` [PATCH 16/25] git-push: Clean-up " freku045
2005-12-10 19:37 ` [PATCH 13/25] git-merge: Print $0 instead of program name in " freku045
2005-12-10 19:37 ` [PATCH 15/25] git-pull: Don't print an extra new line at the end of the " freku045
2005-12-10 19:37 ` [PATCH 12/25] git-lost-found: Print usage message on incorrect invocation freku045
2005-12-10 19:37 ` [PATCH 11/25] git-revert: Fix usage message freku045
2005-12-10 19:37 ` [PATCH 14/25] git-prune: Print $0 instead of program name in " freku045
2005-12-10 19:37 ` [PATCH 18/25] git-repack: Print usage message on unrecognized option freku045
2005-12-10 19:37 ` [PATCH 19/25] git-request-pull: Print usage message to stderr freku045
2005-12-10 19:37 ` [PATCH 23/25] git-tag: Clean-up usage message freku045
2005-12-10 19:37 ` [PATCH 22/25] git-status: Print usage message on incorrect invocation freku045
2005-12-10 19:37 ` [PATCH 17/25] git-relink: Print usage message to stderr freku045
2005-12-11 4:26 ` Junio C Hamano
2005-12-10 19:37 ` [PATCH 20/25] git-reset: Use $0 instead of program name in usage message freku045
2005-12-10 19:37 ` [PATCH 21/25] git-send-email: Usage message clean-up freku045
2005-12-11 4:30 ` Junio C Hamano
2005-12-10 19:38 ` [PATCH 24/25] git-verify-tag: Clean-up usage message freku045
2005-12-10 19:38 ` [PATCH 25/25] git-mv: " freku045
2005-12-10 22:13 ` [PATCH 0/25] Usage message clean-up A Large Angry SCM
2005-12-10 22:50 ` Johannes Schindelin
2005-12-11 2:58 ` Junio C Hamano
2005-12-11 11:16 ` Nikolai Weibull
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11342434771080-git-send-email-freku045@student.liu.se \
--to=freku045@student.liu.se \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).