1. Stefan Saasen
  2. git

Commits

Matthias Kestenholz  committed fe77bb1

annotate: display usage information if no filename was given

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

  • Participants
  • Parent commits d0ad165
  • Branches master

Comments (0)

Files changed (1)

File git-annotate.perl

View file
 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
 			Use revs from revs-file instead of calling git-rev-list
 	-h, --help
 			This message.
-';
+";
 
 	exit(1);
 }
 			"help|h" => \$help,
 			"rename|r" => \$rename,
 			"rev-file|S=s" => \$rev_file);
-if (!$rc or $help) {
+if (!$rc or $help or !@ARGV) {
 	usage();
 }