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: Re: [PATCH] send-email: add option -h
Date: Tue, 6 Sep 2011 08:32:36 +0200	[thread overview]
Message-ID: <20110906063236.GA4923@ecki> (raw)
In-Reply-To: <7vk49mbvlk.fsf@alter.siamese.dyndns.org>

On Mon, Sep 05, 2011 at 01:08:39PM -0700, Junio C Hamano wrote:
> Clemens Buchacher <drizzd@aon.at> writes:
> 
> > Most other git commands print a synopsis when passed -h. Make
> > send-email do the same.
> >
> > Signed-off-by: Clemens Buchacher <drizzd@aon.at>
> > ...
> > +my $help;
> > +my $rc = GetOptions("help|H|h" => \$help,
> 
> I do not think what the patch aims to do is wrong per-se, but
> 
>  $ git send-email --help
> 
> already shows the full documentation, and I find it is misleading to say
> "help|H|h" here to pretend as if a long-help is triggered with this
> command. For that matter, do we have any other place that accept -H for
> help?
> 
> IOW, shouldn't this line be this instead?
> 
> > +my $rc = GetOptions("h" => \$help,

Sure. I was just copy-pasting from git-svn.perl. And in fact I
_was_ confused by the fact that it also seemed to allow --help, but
in fact did not handle that case any different.

Just found a few more places, so how about this on top?

-->8--
From: Clemens Buchacher <drizzd@aon.at>
Date: Tue, 6 Sep 2011 08:27:13 +0200
Subject: [PATCH] use -h for synopsis and --help for manpage consistently

The "git cmd --help" syntax is translated into "git help cmd" by
git.c. Do not pretend to handle such cases in any individual
commands.

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

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 1b8bff2..6c5185e 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -109,14 +109,14 @@ my $usage =
     "    --strict-paths      : Don't allow recursing into subdirectories\n".
     "    --export-all        : Don't check for gitcvs.enabled in config\n".
     "    --version, -V       : Print version information and exit\n".
-    "    --help, -h, -H      : Print usage information and exit\n".
+    "    -h                  : Print usage information and exit\n".
     "\n".
     "<directory> ... is a list of allowed directories. If no directories\n".
     "are given, all are allowed. This is an additional restriction, gitcvs\n".
     "access still needs to be enabled by the gitcvs.enabled config option.\n".
     "Alternately, one directory may be specified in GIT_CVSSERVER_ROOT.\n";
 
-my @opts = ( 'help|h|H', 'version|V',
+my @opts = ( 'h', 'version|V',
 	     'base-path=s', 'strict-paths', 'export-all' );
 GetOptions( $state, @opts )
     or die $usage;
diff --git a/git-pull.sh b/git-pull.sh
index 63da37b..f08372a 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -120,7 +120,7 @@ do
 	--d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run)
 		dry_run=--dry-run
 		;;
-	-h|--h|--he|--hel|--help|--help-|--help-a|--help-al|--help-all)
+	-h)
 		usage
 		;;
 	*)
diff --git a/git-send-email.perl b/git-send-email.perl
index 4ac6931..734356a 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -276,7 +276,7 @@ $SIG{INT}  = \&signal_handler;
 # needing, first, from the command line:
 
 my $help;
-my $rc = GetOptions("help|H|h" => \$help,
+my $rc = GetOptions("h" => \$help,
 		    "sender|from=s" => \$sender,
                     "in-reply-to=s" => \$initial_reply_to,
 		    "subject=s" => \$initial_subject,
diff --git a/git-svn.perl b/git-svn.perl
index 89f83fd..a019f55 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -294,7 +294,7 @@ read_git_config(\%opts);
 if ($cmd && ($cmd eq 'log' || $cmd eq 'blame')) {
 	Getopt::Long::Configure('pass_through');
 }
-my $rv = GetOptions(%opts, 'help|H|h' => \$_help, 'version|V' => \$_version,
+my $rv = GetOptions(%opts, 'h' => \$_help, 'version|V' => \$_version,
                     'minimize-connections' => \$Git::SVN::Migration::_minimize,
                     'id|i=s' => \$Git::SVN::default_ref_id,
                     'svn-remote|remote|R=s' => sub {
-- 
1.7.6.1

  reply	other threads:[~2011-09-06  6:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-03 17:06 [PATCH] send-email: add option -h Clemens Buchacher
2011-09-05 20:08 ` Junio C Hamano
2011-09-06  6:32   ` Clemens Buchacher [this message]
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=20110906063236.GA4923@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).