[Rubygems-developers] [PATCH] Two changes to the gem list command
drbrain at segment7.net
Mon Aug 4 14:07:52 EDT 2008
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  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
> $ 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
> 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
> 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
> Rubygems-developers mailing list
> Rubygems-developers at rubyforge.org
More information about the Rubygems-developers