null+****@clear*****
null+****@clear*****
Tue Feb 28 15:04:04 JST 2012
SHIMADA Koji 2012-02-28 15:04:04 +0900 (Tue, 28 Feb 2012) New Revision: 747fd6788075edd7e6e67ddd57ce9b9bddc3f826 Log: Add '--no-color' option to lookup command Modified files: lib/logaling/command/application.rb Modified: lib/logaling/command/application.rb (+2 -1) =================================================================== --- lib/logaling/command/application.rb 2012-02-28 02:17:34 +0900 (54c596a) +++ lib/logaling/command/application.rb 2012-02-28 15:04:04 +0900 (f35f7da) @@ -213,6 +213,7 @@ module Logaling::Command desc 'lookup [TERM]', 'Lookup terms.' method_option "output", type: :string, default: "terminal" method_option "no-pager", type: :boolean, default: false + method_option "no-color", type: :boolean, default: false method_option "dictionary", type: :boolean, default: false, aliases: "--dict" def lookup(source_term) check_logaling_home_exists @@ -360,7 +361,7 @@ module Logaling::Command end def extract_keyword_and_coloring(snipped_term, term) - return term if snipped_term.empty? + return term if snipped_term.empty? || options["no-color"] display_string = snipped_term.map do |word| word.is_a?(Hash) ? word[:keyword].bright : word end