Skip to content

Commit

Permalink
annotate: display usage information if no filename was given
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
  • Loading branch information
Matthias Kestenholz authored and Junio C Hamano committed Apr 28, 2006
1 parent d0ad165 commit fe77bb1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions git-annotate.perl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
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
Expand All @@ -23,7 +24,7 @@ ()
Use revs from revs-file instead of calling git-rev-list
-h, --help
This message.
';
";

exit(1);
}
Expand All @@ -35,7 +36,7 @@ ()
"help|h" => \$help,
"rename|r" => \$rename,
"rev-file|S=s" => \$rev_file);
if (!$rc or $help) {
if (!$rc or $help or !@ARGV) {
usage();
}

Expand Down

0 comments on commit fe77bb1

Please sign in to comment.