All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Kestenholz <matthias@spinlock.ch>
To: junkio@cox.net
Cc: git@vger.kernel.org
Subject: [PATCH] annotate: display usage information if no filename was given
Date: Fri, 28 Apr 2006 10:41:19 +0200	[thread overview]
Message-ID: <20060428084119.GA4313@spinlock.ch> (raw)


Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>

---

 git-annotate.perl |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

ec31877f02673ed1db9d1485ac0065d51cbb7039
diff --git a/git-annotate.perl b/git-annotate.perl
index 9df72a1..bf920a5 100755
--- a/git-annotate.perl
+++ b/git-annotate.perl
@@ -10,9 +10,10 @@ use warnings;
 use strict;
 use Getopt::Long;
 use POSIX qw(strftime gmtime);
+use File::Basename qw(basename dirname);
 
 sub usage() {
-	print STDERR 'Usage: ${\basename $0} [-s] [-S revs-file] file [ revision ]
+	print STDERR "Usage: ${\basename $0} [-s] [-S revs-file] file [ revision ]
 	-l, --long
 			Show long rev (Defaults off)
 	-t, --time
@@ -23,7 +24,7 @@ sub usage() {
 			Use revs from revs-file instead of calling git-rev-list
 	-h, --help
 			This message.
-';
+";
 
 	exit(1);
 }
@@ -35,7 +36,7 @@ my $rc = GetOptions(	"long|l" => \$longr
 			"help|h" => \$help,
 			"rename|r" => \$rename,
 			"rev-file|S=s" => \$rev_file);
-if (!$rc or $help) {
+if (!$rc or $help or !@ARGV) {
 	usage();
 }
 
-- 
1.3.1.gc4586

                 reply	other threads:[~2006-04-28  9:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060428084119.GA4313@spinlock.ch \
    --to=matthias@spinlock.ch \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.