aboutsummaryrefslogtreecommitdiff
path: root/git-annotate.perl
diff options
context:
space:
mode:
authorMatthias Kestenholz <matthias@spinlock.ch>2006-04-28 10:41:19 +0200
committerJunio C Hamano <junkio@cox.net>2006-04-28 14:29:04 -0700
commitfe77bb1a02d5b8dd3915cd27a83b660debaecda4 (patch)
tree73e330df2d15241adca94207cb79c6398f93eeea /git-annotate.perl
parentd0ad1653662a214baddc1d1ce669a28b91a3ae76 (diff)
downloadgit-fe77bb1a02d5b8dd3915cd27a83b660debaecda4.tar.gz
git-fe77bb1a02d5b8dd3915cd27a83b660debaecda4.tar.xz
annotate: display usage information if no filename was given
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Diffstat (limited to 'git-annotate.perl')
-rwxr-xr-xgit-annotate.perl7
1 files changed, 4 insertions, 3 deletions
diff --git a/git-annotate.perl b/git-annotate.perl
index a7aab2566..a6a7a482c 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" => \$longrev,
"help|h" => \$help,
"rename|r" => \$rename,
"rev-file|S=s" => \$rev_file);
-if (!$rc or $help) {
+if (!$rc or $help or !@ARGV) {
usage();
}