git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] annotate: display usage information if no filename was given
@ 2006-04-28  8:41 Matthias Kestenholz
  0 siblings, 0 replies; only message in thread
From: Matthias Kestenholz @ 2006-04-28  8:41 UTC (permalink / raw)
  To: junkio; +Cc: git


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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-28  9:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-28  8:41 [PATCH] annotate: display usage information if no filename was given Matthias Kestenholz

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 NNTP newsgroup(s).