Re: [PATCH] difftool: print list of valid tools with '--tool-help'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 15, 2012 at 3:32 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Tim Henigan <tim.henigan@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]