aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/options.rb')
-rw-r--r--lib/sisu/v3/options.rb24
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/sisu/v3/options.rb b/lib/sisu/v3/options.rb
index b5771590..5b179a57 100644
--- a/lib/sisu/v3/options.rb
+++ b/lib/sisu/v3/options.rb
@@ -62,11 +62,12 @@ module SiSU_commandline
require_relative 'sysenv' # sysenv.rb
@@base_path=nil
class Options
- attr_accessor :cmd,:mod,:act,:dir_structure_by,:f_pths,:files,:base_path,:base_stub,:paths,:lngs,:f_pth,:pth,:fns,:fnb,:fnc,:fncb,:lng,:what
+ attr_accessor :cmd,:mod,:act,:dir_structure_by,:f_pths,:files,:base_path,:base_stub,:paths,:lngs,:f_pth,:pth,:fns,:fnb,:fnc,:fncb,:lng,:lng_base,:what
def initialize(a)
- @cmd,@f_pth,@pth,@fns,@fnb,@fnc,@fncb,@what,@lng,@base_path,@base_stub='','','','','','','','','','','',''
+ @cmd,@f_pth,@pth,@fns,@fnb,@fnc,@fncb,@what,@lng,@lng_base,@base_path,@base_stub='','','','','','','','','','','','',''
@f_pths,@files,@paths,@mod,@act=Array.new(5){[]}
@env=SiSU_Env::Info_env.new
+ @lng_base=@env.language_default_set
@dir_structure_by=SiSU_Env::Env_call.new.output_dir_structure.by?
@@base_path ||=Dir.pwd
@base_path=@@base_path
@@ -134,7 +135,7 @@ module SiSU_commandline
end
end
r=Px[:lng_lst].join('|')
- r.gsub!(/\|en\|/,'|')
+ r.gsub!(/\|#{@lng_base}\|/,'|')
@lang_regx=%r{(?:#{r})}
z=if find_flag
if f.length > 0
@@ -144,7 +145,7 @@ module SiSU_commandline
end
elsif a.inspect =~/"(?:-\S+?|--\S+?)"/ \
&& a.inspect =~/"#{@lang_regx}\/?"/ \
- && a.inspect =~/"en\/\S+?\.ss[tm]"/
+ && a.inspect =~/"#{@lng_base}\/\S+?\.ss[tm]"/
init_selected_lang_dirs(a)
else b
end
@@ -154,7 +155,7 @@ module SiSU_commandline
def init_selected_lang_dirs(a)
@z=[]
a.each do |y|
- if y =~/^en\/(\S+?\.ss[tm])$/
+ if y =~/^#{@lng_base}\/(\S+?\.ss[tm])$/
@fn=$1
@z << y
elsif y =~/^#{@lang_regx}\/?$/
@@ -177,8 +178,10 @@ module SiSU_commandline
@lngs = q[:lngs]
if @files.length > 0 \
and @cmd.empty? \
- and @mod.length==0 #% if no other action called on filename given, default is sisu -0 [filename(s)] configured as flag default
- @cmd=shortcut.cf_0
+ and @mod.length==0 #% if no other action called on filename given, default is sisu --v3 -0 [filename(s)] configured as flag default
+ shortcut=SiSU_Env::Info_processing_flag.new
+ @mod=['--v3']
+ @cmd=shortcut.cf_0 + 'm'
end
SiSU_Screen::Ansi.new(@cmd,"\tsisu " + @cmd + ' ' + @mod.join(' ') + ' ' + @files.join(' ') + "\n").print_brown if @cmd =~/[vVM]/
end
@@ -217,13 +220,13 @@ module SiSU_commandline
l_p
elsif x =~/~(#{r})\.ss[tm]/
$1
- else 'en'
+ else lng_base
end
lng_is =if l_p
l_p
elsif x =~/~(#{r})\.ss[tm]/
$1
- else 'en'
+ else lng_base
end
f_pths << {
pth: pt.split[0].realpath.to_s,
@@ -586,6 +589,9 @@ module SiSU_commandline
def lng
@lng
end
+ def lng_base
+ @lng_base
+ end
def fns
@fns
end