summaryrefslogtreecommitdiff
path: root/lib/irb/init.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-05-15 16:36:33 +0900
committeraycabta <aycabta@gmail.com>2019-05-21 08:57:21 +0900
commit3a9008b9845db544d0788851f9527ce9f9f6bf4a (patch)
tree0bc7cd93696f1a57b2d25e6a72df71bde72ecf44 /lib/irb/init.rb
parentdf6a673ca55d26a768ead23466c7e055a8596d7a (diff)
Add --colorize and --nocolorize options to IRB
Diffstat (limited to 'lib/irb/init.rb')
-rw-r--r--lib/irb/init.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/irb/init.rb b/lib/irb/init.rb
index 344b243f12..d2e325b86e 100644
--- a/lib/irb/init.rb
+++ b/lib/irb/init.rb
@@ -44,6 +44,7 @@ module IRB # :nodoc:
@CONF[:IRB_RC] = nil
@CONF[:USE_READLINE] = false unless defined?(ReadlineInputMethod)
+ @CONF[:USE_COLORIZE] = true
@CONF[:INSPECT_MODE] = true
@CONF[:USE_TRACER] = false
@CONF[:USE_LOADER] = false
@@ -171,6 +172,10 @@ module IRB # :nodoc:
@CONF[:VERBOSE] = true
when "--noverbose"
@CONF[:VERBOSE] = false
+ when "--colorize"
+ @CONF[:USE_COLORIZE] = true
+ when "--nocolorize"
+ @CONF[:USE_COLORIZE] = false
when /^--prompt-mode(?:=(.+))?/, /^--prompt(?:=(.+))?/
opt = $1 || argv.shift
prompt_mode = opt.upcase.tr("-", "_").intern