From a4e463e111ba498197315b8c6e5d882eb73be4a8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 28 Dec 2012 12:25:17 -0500 Subject: v4: sisu: --color flag, which toggles color on/off (Closes: #622171) * the fix here is specific to color on/off for reporting of sisu version * sisu --version --color-off || sisu -v -k || sisu -kv * there are various ways to control color output to screen * --color-off or -k switches color off * --color or --color-on switches color on, which is usually the default * --color-toggle or -c toggles the default setting (in most cases) * sisurc.yml can set default color state which affects most screen output --- lib/sisu/v4/screen_text_color.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/sisu/v4/screen_text_color.rb') diff --git a/lib/sisu/v4/screen_text_color.rb b/lib/sisu/v4/screen_text_color.rb index a9c0b367..1a4f87b9 100644 --- a/lib/sisu/v4/screen_text_color.rb +++ b/lib/sisu/v4/screen_text_color.rb @@ -68,12 +68,12 @@ module SiSU_Screen @cmd,@txt=cmd,txt @color_instruct=txt[0] flag=SiSU_Env::InfoProcessingFlag.new - if @cmd + if cmd #set default colors on or off -c acts as toggle against this default, if default is off -c turns on, if default is on -c turns off @use_color=(flag.color) \ - ? ((@cmd =~/c/) ? false : true) - : ((@cmd =~/c/) ? true : false) - if @cmd =~/k/ then @use_color=false # useful color off switch, however, k may be used for something else in future + ? ((cmd =~/c/) ? false : true) + : ((cmd =~/c/) ? true : false) + if cmd =~/k/ then @use_color=false # useful color off switch, however, k may be used for something else in future end else @use_color=false end -- cgit v1.2.3