aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v3/options.rb43
1 files changed, 41 insertions, 2 deletions
diff --git a/lib/sisu/v3/options.rb b/lib/sisu/v3/options.rb
index fa1fc973..4364b06c 100644
--- a/lib/sisu/v3/options.rb
+++ b/lib/sisu/v3/options.rb
@@ -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