gracefully handle 0 matches.

This commit is contained in:
Adam Sanderson 2010-08-16 21:06:58 -07:00
parent c59a690643
commit 2787a16a9f
1 changed files with 5 additions and 1 deletions

View File

@ -101,7 +101,11 @@ if __FILE__ == $0
end
package = nil
if packages.length == 1
case packages.length
when 0
puts "No packages matched '#{name}'"
exit 1
when 1
package = packages.first
else
packages.each_with_index do |package, index|