From 728ed46232abea87eb1f0d5fabd52dc710b1e922 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 5 Feb 2014 00:48:39 -0500 Subject: v5 v6: options, ocn switch on/off instructions (& defaults for plaintext & odt) --- lib/sisu/v5/options.rb | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) (limited to 'lib/sisu/v5/options.rb') diff --git a/lib/sisu/v5/options.rb b/lib/sisu/v5/options.rb index d3a40407..bce0a8a4 100644 --- a/lib/sisu/v5/options.rb +++ b/lib/sisu/v5/options.rb @@ -666,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 } @@ -865,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 } @@ -894,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 } -- cgit v1.2.3