diff options
Diffstat (limited to 'lib/sisu/v3/options.rb')
-rw-r--r-- | lib/sisu/v3/options.rb | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/lib/sisu/v3/options.rb b/lib/sisu/v3/options.rb index fa1fc973..7aee2e7d 100644 --- a/lib/sisu/v3/options.rb +++ b/lib/sisu/v3/options.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: @@ -63,9 +63,47 @@ module SiSU_commandline class Options attr_accessor :cmd,:mod,:f_pths,:files,:paths,:f_pth,:pth,:fns,:fnb,:fnc,:fncb,:what def initialize(a) - @cmd,@f_pth,@pth,@fns,@fnb,@fnc,@fncb,@what,c,w,s='','','','','','','','','','','','' - @f_pths,@files,@paths,@mod,m,f,pth,z,ca=[],[],[],[],[],[],[],[],[] + @a=a + @cmd,@f_pth,@pth,@fns,@fnb,@fnc,@fncb,@what='','','','','','','','','' + @f_pths,@files,@paths,@mod=[],[],[],[] @env=SiSU_Env::Info_env.new + r=Px[:lng_lst].join('|') + #r.gsub!(/\|en\|/,'|') + @lang_regx=%r{(?:#{r})} + if a.inspect =~/"(?:-\S|--\S+?)"/ \ + and a.inspect =~/"#{@lang_regx}"/ \ + and a.inspect =~/"en\/\S+?\.ss[tm]"/ + init_po + end + init + end + def init_po + a=@a + if a.inspect =~/"(?:-\S|--\S+?)"/ \ + and a.inspect =~/"#{@lang_regx}"/ \ + and a.inspect =~/"en\/\S+?\.ss[tm]"/ + x,z=[],[] + l=nil + a.each do |y| + if y =~/^(?:-\S|--\S+?)$/ + x << y + elsif y =~/^en\/(\S+?\.ss[tm])$/ + l=$1 + x << y + elsif y =~/^#{@lang_regx}$/ + z = x.dup + z << y + '/' + l + SiSU_commandline::Options.new(z) + z=[] + end + end + end + self + end + def init + a=@a + c,w,s='','','' + m,f,pth,z,ca=[],[],[],[],[] shortcut=SiSU_Env::Info_processing_flag.new a.each do |x| y=case x @@ -203,6 +241,7 @@ module SiSU_commandline end end @files + self end def cmd @cmd |