Skip to content

Commit

Permalink
Use nil instead of -1 to check the number of lines to display
Browse files Browse the repository at this point in the history
  • Loading branch information
ganmacs committed Sep 5, 2016
1 parent 88ecee9 commit d128ec5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fluent/command/binlog_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def call
i = 1
Fluent::MessagePackFactory.unpacker(io).each do |(time, record)|
print @formatter.format(@path, time, record) # path is used for tag
break if i == @options[:count] && @options[:count] != -1
break if @options[:count] && i == @options[:count]
i += 1
end
end
Expand Down Expand Up @@ -196,7 +196,7 @@ def parse_options!

class Cat < Head
DEFAULT_CAT_OPTIONS = {
count: -1
count: nil # Overwrite DEFAULT_HEAD_OPTIONS[:count]
}

def default_options
Expand Down

0 comments on commit d128ec5

Please sign in to comment.