Code

send-email: add option -h
authorClemens Buchacher <drizzd@aon.at>
Sat, 3 Sep 2011 17:06:13 +0000 (19:06 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Sep 2011 00:00:23 +0000 (17:00 -0700)
Most other git commands print a synopsis when passed -h. Make
send-email do the same.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl

index 98ab33aae7e35c2d288bc34ddb2bbc71f8a16cdd..734356a6fb3b22dceb4a1afe7751811628b60ce7 100755 (executable)
@@ -275,7 +275,9 @@ $SIG{INT}  = \&signal_handler;
 # Begin by accumulating all the variables (defined above), that we will end up
 # needing, first, from the command line:
 
-my $rc = GetOptions("sender|from=s" => \$sender,
+my $help;
+my $rc = GetOptions("h" => \$help,
+                   "sender|from=s" => \$sender,
                     "in-reply-to=s" => \$initial_reply_to,
                    "subject=s" => \$initial_subject,
                    "to=s" => \@initial_to,
@@ -313,6 +315,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
                    "force" => \$force,
         );
 
+usage() if $help;
 unless ($rc) {
     usage();
 }