lib/command/list.rb in narou-3.2.5.1 vs lib/command/list.rb in narou-3.3.0

- old
+ new

@@ -1,6 +1,7 @@ -# -*- coding: utf-8 -*- +# frozen_string_literal: true + # # Copyright 2013 whiteleaf. All rights reserved. # require_relative "../database" @@ -130,12 +131,12 @@ when "frozen" frozen when "nonfrozen" !frozen else - error "不明なフィルターです(#{item})" - warn "filters = #{filter_type_help}" + stream_io.error "不明なフィルターです(#{item})" + stream_io.puts "filters = #{filter_type_help}" exit Narou::EXIT_ERROR_CODE end sum + (apply ? 1 : 0) end apply_sum == filters.count @@ -201,22 +202,23 @@ selected_lines end def output_lines(took_lines) if STDOUT.tty? - puts header - puts took_lines.values.join("\n").termcolor + stream_io.puts header + stream_io.puts took_lines.values.join("\n").termcolor elsif @options["echo"] # pipeにそのまま出力するときはansicolorコードが邪魔なので削除 - puts header - puts TermColorLight.strip_tag(took_lines.values.join("\n")) + stream_io.puts header + stream_io.puts TermColorLight.strip_tag(took_lines.values.join("\n")) else # pipeに接続するときはIDを渡す - puts took_lines.keys.join(" ") + stream_io.puts took_lines.keys.join(" ") end end def execute(argv) + disable_logging super database_values = Database.instance.get_object.values limit = if !argv.empty? && argv.first =~ /^\d+$/ argv.first.to_i