aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/options.rb')
-rw-r--r--lib/sisu/v5/options.rb59
1 files changed, 47 insertions, 12 deletions
diff --git a/lib/sisu/v5/options.rb b/lib/sisu/v5/options.rb
index 65af15b4..bce0a8a4 100644
--- a/lib/sisu/v5/options.rb
+++ b/lib/sisu/v5/options.rb
@@ -62,7 +62,11 @@
=end
module SiSU_Commandline
- require 'pathname'
+ begin
+ require 'pathname'
+ rescue LoadError
+ SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pathname NOT FOUND (LoadError)')
+ end
require_relative 'sysenv' # sysenv.rb
require_relative 'param_make' # param_make.rb
@@sisu_call_origin_path=nil
@@ -662,9 +666,9 @@ module SiSU_Commandline
{ set: :filetype }
else { set: :na }
end
- act[:ocn]=if mod.inspect =~/"--inc-ocn"/
+ act[:ocn]=if mod.inspect =~/"--ocn"|"--inc-ocn"/
{ bool: true, set: :on }
- elsif mod.inspect =~/"--(?:exc|no)-ocn"/ \
+ elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"/ \
|| act[:switch][:off].inspect =~/"ocn"/
{ bool: false, set: :off }
else { bool: true, set: :na }
@@ -765,12 +769,23 @@ module SiSU_Commandline
{ bool: false, set: :off }
else { bool: true, set: :na }
end
- act[:html]=if (cmd =~/h/ \
+ act[:html]=if mod.inspect =~/"--html-strict"/ \
+ or ((cmd =~/h/ || mod.inspect =~/"--html"/) \
+ && mod.inspect =~/"--strict"/)
+ act[:html_strict]={ bool: true, set: :on }
+ act[:html_scroll]={ bool: true, set: :on }
+ act[:html_seg]={ bool: true, set: :on }
+ { bool: true, set: :on }
+ elsif (cmd =~/h/ \
|| mod.inspect =~/"--html"/)
+ act[:html_strict]={ bool: false, set: :off }
act[:html_scroll]={ bool: true, set: :on }
act[:html_seg]={ bool: true, set: :on }
{ bool: true, set: :on }
else
+ act[:html_strict]=(mod.inspect =~/"--strict"/) \
+ ? { bool: true, set: :on }
+ : { bool: false, set: :na }
act[:html_scroll]=(mod.inspect =~/"--html-scroll"/) \
? { bool: true, set: :on }
: { bool: false, set: :na }
@@ -850,10 +865,20 @@ module SiSU_Commandline
|| mod.inspect =~/"--epub"/) \
? { bool: true, set: :on }
: { bool: false, set: :na }
- act[:odt]=(cmd =~/o/ \
- || mod.inspect =~/"--odt"|"--odf"/) \
- ? { bool: true, set: :on }
- : { bool: false, set: :na }
+ act[:odt]=if cmd =~/o/ \
+ or mod.inspect =~/"--odt"|"--odf"|"--odt-ocn"|"--odf-ocn"/
+ act[:odt_ocn]=if (mod.inspect =~/"--odt-ocn"|"--odf-ocn"/ \
+ or mod.inspect =~/"--ocn"|"--inc-ocn"/)
+ { bool: true, set: :on }
+ elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"/
+ { bool: false, set: :off }
+ else
+ { bool: false, set: :na }
+ end
+ { bool: true, set: :on }
+ else
+ { bool: false, set: :na }
+ end
act[:xml_sax]=(cmd =~/x/ \
|| mod.inspect =~/"--xml-sax"/) \
? { bool: true, set: :on }
@@ -879,10 +904,20 @@ module SiSU_Commandline
|| mod.inspect =~/"--xhtml"/) \
? { bool: true, set: :on }
: { bool: false, set: :na }
- act[:txt]=(cmd =~/[at]/ \
- || mod.inspect =~/"--txt"/) \
- ? { bool: true, set: :on }
- : { bool: false, set: :na }
+ act[:txt]=if cmd =~/[at]/ \
+ or mod.inspect =~/"--txt"|"--text"|"--plaintext"|"--txt-ocn"|"--text-ocn"|"--plaintext-ocn"/
+ act[:txt_ocn]=if (mod.inspect =~/"--txt-ocn"|"--text-ocn"|"--plaintext-ocn"/ \
+ or mod.inspect =~/"--ocn"|"--inc-ocn"/)
+ { bool: true, set: :on }
+ elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"/
+ { bool: false, set: :off }
+ else
+ { bool: false, set: :na }
+ end
+ { bool: true, set: :on }
+ else
+ { bool: false, set: :na }
+ end
act[:txt_textile]=(mod.inspect =~/"--textile"/) \
? { bool: true, set: :on }
: { bool: false, set: :na }