From: David Aguilar <davvid@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Tim Henigan <tim.henigan@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] difftool: print list of valid tools with '--tool-help'
Date: Fri, 16 Mar 2012 20:31:07 -0700 [thread overview]
Message-ID: <CAJDDKr4bevWPjvQVLiWYm_6LxiHObms+i2QfeKKJB2g4eF6RnA@mail.gmail.com> (raw)
In-Reply-To: <7vk42lijfu.fsf@alter.siamese.dyndns.org>
On Thu, Mar 15, 2012 at 3:32 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Tim Henigan <tim.henigan@gmail.com> writes:
>
>> @@ -100,6 +101,15 @@ sub generate_command
>> if ($arg eq '-h') {
>> usage();
>> }
>> + if ($arg eq '--tool-help') {
>> + my $gitpath = Git::exec_path();
>> + print "'git difftool --tool=<tool>' may be set to one of the following:\n";
>> + for (glob "$gitpath/mergetools/*") {
>> + next if /defaults$/;
>> + print "\t" . basename($_) . "\n";
>> + }
>> + exit(1);
>> + }
>
> I know the call to usage() against "-h" has the same issue, but I think
> people find it offensive when they ask for help and the command reports a
> failure with a non-zero exit code.
>
> Other than that, looks good from a cursory look. Davidd, any comments?
I agree that the rework to make -h return 0 is sensible. I also think
the `cando()` suggestion later in this thread is the way to go.
Thanks guys,
--
David
next prev parent reply other threads:[~2012-03-17 3:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-15 22:25 [PATCH] difftool: print list of valid tools with '--tool-help' Tim Henigan
2012-03-15 22:32 ` Junio C Hamano
2012-03-17 3:31 ` David Aguilar [this message]
2012-03-15 23:18 ` Junio C Hamano
2012-03-23 18:26 ` Tim Henigan
2012-03-23 19:48 ` Junio C Hamano
2012-03-26 16:23 ` [PATCH 9/9 v7] " Tim Henigan
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=CAJDDKr4bevWPjvQVLiWYm_6LxiHObms+i2QfeKKJB2g4eF6RnA@mail.gmail.com \
--to=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=tim.henigan@gmail.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).