[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: 747fd6788075edd7e6e67ddd57ce9b9bddc3f826

  Merged c1d041f: Merge pull request #54 from logaling/fix-loga-config

  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




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