{"thread":{"id":"3985","subject":"[PATCH] annotate: display usage information if no filename was given","startedAt":"2006-04-28T08:41:19Z","lastAt":"2006-04-28T08:41:19Z","messageCount":1,"participants":["Matthias Kestenholz"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"19223","messageId":"20060428084119.GA4313@spinlock.ch","threadId":"3985","inReplyTo":null,"subject":"[PATCH] annotate: display usage information if no filename was given","fromName":"Matthias Kestenholz","fromEmail":"matthias@spinlock.ch","sentAt":"2006-04-28T08:41:19Z","receivedAt":"2006-04-28T08:41:19Z","isPatch":true,"sender":{"key":"matthias@spinlock.ch","avatar":"https://gravatar.com/avatar/bc18f396e70163d09ab458a341b1decb7e8b6ee3aa2c0c954ec20162e67c4d46?d=mp&s=160"},"body":"\nSigned-off-by: Matthias Kestenholz <matthias@spinlock.ch>\n\n---\n\n git-annotate.perl |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\nec31877f02673ed1db9d1485ac0065d51cbb7039\ndiff --git a/git-annotate.perl b/git-annotate.perl\nindex 9df72a1..bf920a5 100755\n--- a/git-annotate.perl\n+++ b/git-annotate.perl\n@@ -10,9 +10,10 @@ use warnings;\n use strict;\n use Getopt::Long;\n use POSIX qw(strftime gmtime);\n+use File::Basename qw(basename dirname);\n \n sub usage() {\n-\tprint STDERR 'Usage: ${\\basename $0} [-s] [-S revs-file] file [ revision ]\n+\tprint STDERR \"Usage: ${\\basename $0} [-s] [-S revs-file] file [ revision ]\n \t-l, --long\n \t\t\tShow long rev (Defaults off)\n \t-t, --time\n@@ -23,7 +24,7 @@ sub usage() {\n \t\t\tUse revs from revs-file instead of calling git-rev-list\n \t-h, --help\n \t\t\tThis message.\n-';\n+\";\n \n \texit(1);\n }\n@@ -35,7 +36,7 @@ my $rc = GetOptions(\t\"long|l\" => \\$longr\n \t\t\t\"help|h\" => \\$help,\n \t\t\t\"rename|r\" => \\$rename,\n \t\t\t\"rev-file|S=s\" => \\$rev_file);\n-if (!$rc or $help) {\n+if (!$rc or $help or !@ARGV) {\n \tusage();\n }\n \n-- \n1.3.1.gc4586\n"}]}