Skip to content

Commit

Permalink
Change cli output to display an empty array instead of exiting when an
Browse files Browse the repository at this point in the history
empty array is returned.
  • Loading branch information
ploubser committed Sep 26, 2012
1 parent 8a483fa commit 9348326
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions bin/jgrep
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,9 @@ begin

if options[:field].empty?
result = JGrep::jgrep((json), expression, nil, options[:start])
unless result == [] or options[:quiet] == true
unless options[:quiet] == true
(options[:flat] == false) ? puts(JSON.pretty_generate(result)) : puts(result.to_json)
end
if result.length == 0
exit 1
end
else
if options[:field].size > 1
JGrep::validate_filters(options[:field])
Expand Down
4 changes: 2 additions & 2 deletions jgrep.gemspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Gem::Specification.new do |s|
s.name = "jgrep"
s.version = "1.3.0.1"
s.version = "1.3.2"

s.authors = ["P Loubser"]
s.date = %q{2011-08-05}
s.date = %q{2012-09-26}
s.default_executable = "jgrep"
s.add_dependency('json')
s.description = "Compare a list of json documents to a simple logical language and returns matches as output"
Expand Down

0 comments on commit 9348326

Please sign in to comment.