git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clemens Buchacher <drizzd@aon.at>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH] send-email: add option -h
Date: Sat, 3 Sep 2011 19:06:13 +0200	[thread overview]
Message-ID: <20110903170612.GA3536@ecki> (raw)

Most other git commands print a synopsis when passed -h. Make
send-email do the same.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
 git-send-email.perl |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 98ab33a..4ac6931 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -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("help|H|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();
 }
-- 
1.7.6.1

             reply	other threads:[~2011-09-03 17:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-03 17:06 Clemens Buchacher [this message]
2011-09-05 20:08 ` [PATCH] send-email: add option -h Junio C Hamano
2011-09-06  6:32   ` Clemens Buchacher
2011-09-06 16:04     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110903170612.GA3536@ecki \
    --to=drizzd@aon.at \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).