[Rubygems-developers] [PATCH] Two changes to the gem list command

Bjørn Arild Mæland bjorn.maeland at gmail.com
Mon Aug 4 17:01:59 EDT 2008


The complete patch, with Martin's input (thanks!) is available here:
http://pastie.org/247307

2008/8/4 Eric Hodel <drbrain at segment7.net>

>
> On Aug 3, 2008, at 02:13 AM, Martin Krauskopf wrote:
>
>  Bjørn Arild Mæland wrote:
>> >   Hi,
>> >
>> >   I've made a couple of very small patches that deals with the list
>> >   command.
>> >
>> >   The first patch [1] causes the list command to exit 1 if "gem list
>> >   <pattern>" has no results.
>> [...]
>>
>> But the patch does not differ between:
>>
>> $ gem list # on *empty* repository
>> $ echo $?  # => 1 but should be 0 in this case
>>
>> and
>>
>> $ gem list abcd_not_exists
>> $ echo $?  # => 1 is correct
>>
>> which is how e.g. 'ls' behaves. 'ls' on empty dir has no result and
>> exist with 0. But ls on non-matching pattern returns 1.
>>
>> Thus tweaking condition in QueryCommand#output_query_results like shown
>> in http://pastie.org/246474 (there is probably better way then
>> '/^/i == options[:name]' for check whether user actually specified
>> pattern on CLI).
>>
>
> Bjørn, can you make this change?  I will commit it.
>
>
>>
>> Also 'ls' shows error in the case there is no matching pattern when the
>> pattern is given. Might be such approach would be taken?
>>
>>  $ ls abcd_not_exists
>>  ls: cannot access abcd_not_exists: No such file or directory
>>
>>        m.
>>
>> _______________________________________________
>> Rubygems-developers mailing list
>> Rubygems-developers at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rubygems-developers
>>
>
> _______________________________________________
> Rubygems-developers mailing list
> Rubygems-developers at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rubygems-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rubygems-developers/attachments/20080804/5c2b9040/attachment-0001.html>


More information about the Rubygems-developers mailing list