From edd89902036bde18c91031470e19c871a182cf6d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Oct 2013 23:40:45 -0400 Subject: v5: options & downstream, more use of opt.act instead of opt.cmd * opt.act.*.set==:on instead of opt.cmd =~/\S/ --- lib/sisu/v5/plaintext.rb | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'lib/sisu/v5/plaintext.rb') diff --git a/lib/sisu/v5/plaintext.rb b/lib/sisu/v5/plaintext.rb index 443b274b..f7c40d7a 100644 --- a/lib/sisu/v5/plaintext.rb +++ b/lib/sisu/v5/plaintext.rb @@ -65,7 +65,7 @@ module SiSU_Plaintext require_relative 'sysenv' # sysenv.rb include SiSU_Env require_relative 'plaintext_format' # plaintext_format.rb - include SiSU_PlaintextFormat + include SiSU_Plaintext_Format require_relative 'shared_metadata' # shared_metadata.rb require_relative 'shared_txt' # shared_txt.rb include SiSU_Param @@ -83,14 +83,21 @@ module SiSU_Plaintext begin md=SiSU_Param::Parameters.new(@opt).get env=SiSU_Env::InfoEnv.new(@opt.fns) - unless @opt.cmd =~/q/ - tool=(@opt.cmd =~/[MVv]/) \ + unless @opt.act[:quiet][:set]==:on + tool=(@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) \ ? "#{env.program.text_editor} #{md.file.output_path.txt.dir}/#{md.file.base_filename.txt}" : "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}" - @opt.cmd=~/[MVvz]/ \ - ? SiSU_Screen::Ansi.new(@opt.cmd,'Plaintext',tool).green_hi_blue - : SiSU_Screen::Ansi.new(@opt.cmd,'Plaintext',tool).green_title_hi - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{md.file.output_path.txt.dir}/#{md.file.base_filename.txt}").flow if @opt.cmd =~/[MV]/ + (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) \ + ? SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Plaintext',tool).green_hi_blue + : SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Plaintext',tool).green_title_hi + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"#{md.file.output_path.txt.dir}/#{md.file.base_filename.txt}").flow + end end dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here wrap_width=if defined? md.make.plaintext_wrap \ @@ -155,15 +162,15 @@ module SiSU_Plaintext : (SiSU_TextUtils::Wrap.new(e.to_s,@wrap_width,1,1)) wrap=util.line_wrap wrap=if wrap =~ /^\s*[\d*+]+\s+.+?\s*\Z/m - wrap.gsub(/^(\s*)([\d*+]+)\s+(.+?)\s*\Z/m, <