diff options
| author | Ralph Amissah <ralph@amissah.com> | 2011-02-01 19:07:29 -0500 | 
|---|---|---|
| committer | Ralph Amissah <ralph@amissah.com> | 2011-02-01 19:08:54 -0500 | 
| commit | 0491018d2df353ea1a9990434ba03c7d0ec07a32 (patch) | |
| tree | 6b0efa6066bf39ea99880e1bb5f192c2789b8589 | |
| parent | v3 introduced as development branch, invoked using "sisu --v3 [instructions] (diff) | |
v3 po4a, options, shortcut representation for processing, keep working on
* sisu --po4a en/live-manual.ssm fr
   instead of:
   sisu --po4a en/live-manual.ssm fr/live-manual.ssm
   test:
   sisu --po4a en/live-manual.ssm fr de
| -rw-r--r-- | lib/sisu/v3/options.rb | 43 | 
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 | 
