From d128ec5b6ee8d09a34bc471e3bd54dd78723d686 Mon Sep 17 00:00:00 2001 From: ganmacs Date: Fri, 2 Sep 2016 18:09:23 +0900 Subject: [PATCH] Use nil instead of -1 to check the number of lines to display --- lib/fluent/command/binlog_reader.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fluent/command/binlog_reader.rb b/lib/fluent/command/binlog_reader.rb index 2226d822ee..5e8447cdbd 100644 --- a/lib/fluent/command/binlog_reader.rb +++ b/lib/fluent/command/binlog_reader.rb @@ -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 @@ -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