aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/options.rb')
-rw-r--r--lib/sisu/v0/options.rb18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/sisu/v0/options.rb b/lib/sisu/v0/options.rb
index 8b014c04..a4cdc5e4 100644
--- a/lib/sisu/v0/options.rb
+++ b/lib/sisu/v0/options.rb
@@ -58,9 +58,9 @@
module SiSU_commandline
require "#{SiSU_lib}/sysenv"
class Options
- attr_accessor :cmd,:mod,:files,:fns,:fnb,:what
+ attr_accessor :cmd,:mod,:files,:fns,:fnb,:fnc,:fncb,:what
def initialize(a)
- @cmd,@files,@fns,@fnb,@what,c,w,s='','','','','','','','',''
+ @cmd,@files,@fns,@fnb,@fnc,@fncb,@what,c,w,s='','','','','','','','','','',''
@files,@mod,m,f,z,ca=[],[],[],[],[],[]
@env=SiSU_Env::Info_env.new
shortcut=SiSU_Env::Info_processing_flag.new
@@ -102,7 +102,7 @@ module SiSU_commandline
end
if x =~/^--\S+/; m << x
end
- elsif x =~ /(?:\.(?:[_-]?sst(?:\.xml)?|ssm|ssi|sx[sdn]\.xml|s[1-3]|kdi|ssp)|sisupod(?:\.zip)?)$/
+ elsif x =~ /(?:\.(?:(?:-|ssm\.)?sst(?:\.xml)?|ssm|ssi|sx[sdn]\.xml|s[1-3]|kdi|ssp)|sisupod(?:\.zip)?)$/
if x =~/^(?:https?|file):\/\/\S+/; f << x
elsif FileTest.file?(x); f << x
else puts "file not found: #{x}"
@@ -162,7 +162,17 @@ module SiSU_commandline
end
def fnb
unless fns.empty?
- fns[/(.+?)\.(?:[_-]?sst|ssm)$/,1]
+ fns[/(.+?)\.(?:(?:-|ssm\.)?sst|ssm)$/,1]
+ end
+ end
+ def fnc
+ @fnc=if @fns =~/\.(?:ssm\.sst|ssm)$/; fnb + '.ssm.sst'
+ else @fns
+ end
+ end
+ def fncb
+ @fncb=if @fns =~/(?:\~\S{2,3})?\.(?:ssm\.sst|ssm)$/; fnb + '.ssm.sst'
+ else @fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1')
end
end
end