[logaling-commit] logaling/logaling-command [master] Add '--no-color' option to lookup command

Zurück zum Archiv-Index

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

  Merged 76b4829: Merge pull request #52 from logaling/add-no-color-option

  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




More information about the logaling-commit mailing list
Zurück zum Archiv-Index