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: 2878ab23daf420fa16471329fe9c67bd5184039b 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 14:49:06 +0900 (61bc418) +++ lib/logaling/command/application.rb 2012-02-28 15:04:04 +0900 (96d7962) @@ -200,6 +200,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) @repository.index @@ -344,7 +345,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