git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] send-email: add option -h

From
Clemens Buchacher <drizzd@aon.at>
Date
Sep 3, 2011, 17:06 UTC
Message-ID
<20110903170612.GA3536@ecki>

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
Next: Junio C Hamano
Message 1 of 4 in “send-email: add option -h”
  1. send-email: add option -hClemens Buchacher, Sep 3, 2011
  2. Junio C HamanoSep 5, 2011
  3. Clemens BuchacherSep 6, 2011
  4. Junio C HamanoSep 6, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.