git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: freku045@student.liu.se
To: git@vger.kernel.org
Cc: Fredrik Kuivinen <freku045@student.liu.se>
Subject: [PATCH 21/25] git-send-email: Usage message clean-up.
Date: Sat, 10 Dec 2005 20:37:59 +0100	[thread overview]
Message-ID: <11342434792231-git-send-email-freku045@student.liu.se> (raw)
In-Reply-To: <1134243476675-git-send-email-freku045@student.liu.se>

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>

---

 git-send-email.perl |   62 ++++++++++++++++++++++++++++-----------------------
 1 files changed, 34 insertions(+), 28 deletions(-)

38fde073a59d00a19111a30e8f804c4e784835e7
diff --git a/git-send-email.perl b/git-send-email.perl
index ec1428d..5f6b729 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -27,6 +27,38 @@ use Email::Valid;
 sub unique_email_list(@);
 sub cleanup_compose_files();
 
+sub usage {
+	print <<EOT;
+$0 [options] <file | directory> [... file | directory ]
+Options:
+   --from         Specify the "From:" line of the email to be sent.
+
+   --to           Specify the primary "To:" line of the email.
+
+   --compose      Use \$EDITOR to edit an introductory message for the
+                  patch series.
+
+   --subject      Specify the initial "Subject:" line.
+                  Only necessary if --compose is also set.  If --compose
+		  is not set, this will be prompted for.
+
+   --in-reply-to  Specify the first "In-Reply-To:" header line.
+                  Only used if --compose is also set.  If --compose is not
+		  set, this will be prompted for.
+
+   --chain-reply-to If set, the replies will all be to the previous
+                  email sent, rather than to the first email sent.
+                  Defaults to on.
+
+   --smtp-server  If set, specifies the outgoing SMTP server to use.
+                  Defaults to localhost.
+EOT
+
+	print $_[0], "\n" if defined $_[0];
+
+	exit(1);
+}
+
 # Constants (essentially)
 my $compose_filename = ".msg.$$";
 
@@ -51,6 +83,7 @@ my $rc = GetOptions("from=s" => \$from,
 		    "chain-reply-to!" => \$chain_reply_to,
 		    "smtp-server=s" => \$smtp_server,
 		    "compose" => \$compose,
+		    "help|h" => sub { usage; },
 	 );
 
 # Now, let's fill any that aren't set in with defaults:
@@ -187,34 +220,7 @@ for my $f (@ARGV) {
 if (@files) {
 	print $_,"\n" for @files;
 } else {
-	print <<EOT;
-git-send-email [options] <file | directory> [... file | directory ]
-Options:
-   --from         Specify the "From:" line of the email to be sent.
-
-   --to           Specify the primary "To:" line of the email.
-
-   --compose      Use \$EDITOR to edit an introductory message for the
-                  patch series.
-
-   --subject      Specify the initial "Subject:" line.
-                  Only necessary if --compose is also set.  If --compose
-		  is not set, this will be prompted for.
-
-   --in-reply-to  Specify the first "In-Reply-To:" header line.
-                  Only used if --compose is also set.  If --compose is not
-		  set, this will be prompted for.
-
-   --chain-reply-to If set, the replies will all be to the previous
-                  email sent, rather than to the first email sent.
-                  Defaults to on.
-
-   --smtp-server  If set, specifies the outgoing SMTP server to use.
-                  Defaults to localhost.
-
-Error: Please specify a file or a directory on the command line.
-EOT
-	exit(1);
+	usage "Error: Please specify a file or a directory on the command line.";
 }
 
 # Variables we set as part of the loop over files
-- 
0.99.9.GIT

  parent reply	other threads:[~2005-12-10 19:38 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-10 19:37 [PATCH 0/25] Usage message clean-up freku045
2005-12-10 19:37 ` [PATCH 1/25] git-bisect: Use $0 instead of program name in usage message freku045
2005-12-10 19:37 ` [PATCH 6/25] git-commit: " freku045
2005-12-10 19:37 ` [PATCH 5/25] git-clone: " freku045
2005-12-10 19:37 ` [PATCH 4/25] git-cherry: Print the usage message if we get an unknown option freku045
2005-12-10 19:37 ` [PATCH 3/25] git-checkout: Use $0 instead of program name in usage message freku045
2005-12-10 19:37 ` [PATCH 2/25] git-branch: " freku045
2005-12-10 19:37 ` [PATCH 8/25] git-fetch: Print usage message if we get an unrecognized option freku045
2005-12-10 19:37 ` [PATCH 7/25] git-count-objects: Die with usage message if we are invoked incorrectly freku045
2005-12-11  4:22   ` Junio C Hamano
2005-12-10 19:37 ` [PATCH 9/25] git-format-patch: Use the 'die'-function where appropriate freku045
2005-12-10 19:37 ` [PATCH 13/25] git-merge: Print $0 instead of program name in usage message freku045
2005-12-10 19:37 ` [PATCH 14/25] git-prune: " freku045
2005-12-10 19:37 ` [PATCH 10/25] git-grep: Print usage message on '-h' and '--help' freku045
2005-12-10 19:37 ` [PATCH 12/25] git-lost-found: Print usage message on incorrect invocation freku045
2005-12-10 19:37 ` [PATCH 16/25] git-push: Clean-up usage message freku045
2005-12-10 19:37 ` [PATCH 15/25] git-pull: Don't print an extra new line at the end of the " freku045
2005-12-10 19:37 ` [PATCH 16/25] git-push: Clean up " freku045
2005-12-10 19:37 ` [PATCH 11/25] git-revert: Fix " freku045
2005-12-10 19:37 ` freku045 [this message]
2005-12-11  4:30   ` [PATCH 21/25] git-send-email: Usage message clean-up Junio C Hamano
2005-12-10 19:37 ` [PATCH 19/25] git-request-pull: Print usage message to stderr freku045
2005-12-10 19:37 ` [PATCH 22/25] git-status: Print usage message on incorrect invocation freku045
2005-12-10 19:37 ` [PATCH 20/25] git-reset: Use $0 instead of program name in usage message freku045
2005-12-10 19:37 ` [PATCH 17/25] git-relink: Print usage message to stderr freku045
2005-12-11  4:26   ` Junio C Hamano
2005-12-10 19:37 ` [PATCH 23/25] git-tag: Clean-up usage message freku045
2005-12-10 19:37 ` [PATCH 18/25] git-repack: Print usage message on unrecognized option freku045
2005-12-10 19:38 ` [PATCH 24/25] git-verify-tag: Clean-up usage message freku045
2005-12-10 19:38 ` [PATCH 25/25] git-mv: " freku045
2005-12-10 22:13 ` [PATCH 0/25] Usage message clean-up A Large Angry SCM
2005-12-10 22:50 ` Johannes Schindelin
2005-12-11  2:58   ` Junio C Hamano
2005-12-11 11:16 ` Nikolai Weibull

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=11342434792231-git-send-email-freku045@student.liu.se \
    --to=freku045@student.liu.se \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).