diff options
Diffstat (limited to 'lib/sisu/v3dv/options.rb')
-rw-r--r-- | lib/sisu/v3dv/options.rb | 94 |
1 files changed, 91 insertions, 3 deletions
diff --git a/lib/sisu/v3dv/options.rb b/lib/sisu/v3dv/options.rb index 4cd071ac..b2b7ff15 100644 --- a/lib/sisu/v3dv/options.rb +++ b/lib/sisu/v3dv/options.rb @@ -362,6 +362,7 @@ module SiSU_Commandline when /^--(?:xhtml)$/; c=c+'b' when /^--(?:xml-sax)$/; c=c+'x' when /^--(?:xml-dom)$/; c=c+'X' + when /^--(?:images)$/; c=c+'j' when /^--(?:hash-digests)$/; c=c+'N' when /^--(?:po4a|pot?)$/; c=c+'P' when /^--(?:termsheet)$/; c=c+'T' @@ -406,6 +407,13 @@ module SiSU_Commandline else '' end end + if cmd !~/j/ + extra+=if cmd =~/[bHhwXxyz]/ \ + and cmd !~/[j]/ + 'j' #% copy images + else '' + end + end if cmd !~/y/ extra+=if cmd =~/[abeHhIiNopsSstwXxz]/ \ and cmd !~/y/ @@ -435,10 +443,26 @@ module SiSU_Commandline : { bool: false } act[:rc]=if mod.inspect =~/"--rc=/ x=Dir.pwd + '/' + mod.join.gsub(/--rc=/,'') - { bool: true, inst: x } + { bool: true, inst: x } else { bool: false, inst: '' } end + act[:dump]=if mod.inspect =~/"--dump=/ + base_pth=mod.join(';').gsub(/^.*--dump=['"]?(.+?)(?:['"]?;.+)?$/,'\1') + { bool: true, inst: base_pth } + elsif mod.inspect =~/"--dump/ + { bool: true, inst: @base_path } + else + { bool: false, inst: nil } + end + act[:redirect]=if mod.inspect =~/"--redirect=/ + base_pth=mod.join(';').gsub(/^.*--redirect=['"]?(.+?)(?:['"]?;.+)?$/,'\1') + { bool: true, inst: base_pth } + elsif mod.inspect =~/"--redirect/ + { bool: true, inst: @base_path } + else + { bool: false, inst: nil } + end act[:verbose]=(cmd =~/v/ \ || mod.inspect =~/"--verbose"/) \ ? { bool: true } @@ -462,8 +486,68 @@ module SiSU_Commandline || mod.inspect =~/"--maintenance|--keep-processing-files"/) \ ? { bool: true } : { bool: false } - act[:ocn]=if mod.inspect =~/"--no-ocn"/ - { bool: false } + act[:switch]=if mod.inspect =~/"--switch-off=/ + off_list=mod.join(';').gsub(/^.*--switch-off=['"]?(.+?)(?:['"];.+)?$/,'\1') + off_list=off_list.scan(/[^,;\s]+/) + { bool: false, off: off_list} + else { bool: true, off: [] } + end + act[:ocn]=if mod.inspect =~/"--no-ocn"/ \ + || act[:switch][:off].inspect =~/"ocn"/ + { bool: false } + else { bool: true } + end + act[:toc]=if mod.inspect =~/"--no-toc"/ \ + || act[:switch][:off].inspect =~/"toc"/ + { bool: false } + else { bool: true } + end + act[:manifest]=if mod.inspect =~/"--no-manifest"/ \ + || act[:switch][:off].inspect =~/"manifest"/ + #|| mod.inspect =~/"--(?:redirect|dump)/ + { bool: false } + else { bool: true } + end + act[:manifest_links]=if mod.inspect =~/"--no-manifest-links"/ \ + || act[:switch][:off].inspect =~/"manifest_links"/ \ + || mod.inspect =~/"--(?:redirect|dump)/ + { bool: false } + else { bool: true } + end + act[:manifest_minitoc]=if mod.inspect =~/"--no-manifest-minitoc"/ \ + || act[:switch][:off].inspect =~/"manifest_minitoc"|"minitoc"/ + #|| mod.inspect =~/"--(?:redirect|dump)/ + { bool: false } + else { bool: true } + end + act[:metadata]=if mod.inspect =~/"--no-metadata"/ \ + || act[:switch][:off].inspect =~/"metadata"/ + { bool: false } + else { bool: true } + end + act[:html_minitoc]=if mod.inspect =~/"--no-html-minitoc"/ \ + || act[:switch][:off].inspect =~/"html_minitoc"|"minitoc"/ + { bool: false } + else { bool: true } + end + act[:html_navigation]=if mod.inspect =~/"--no-html-navigation"/ \ + || act[:switch][:off].inspect =~/"html_navigation"|"nav"/ + { bool: false } + else { bool: true } + end + act[:html_navigation_bar]=if mod.inspect =~/"--no-html-navigation-bar"/ \ + || act[:switch][:off].inspect =~/"html_navigation_bar"|"navbar"/ + { bool: false } + else { bool: true } + end + act[:html_search_form]=if mod.inspect =~/"--no-html-search-form"/ \ + || act[:switch][:off].inspect =~/"html_search_form"|"search"/ + { bool: false } + else { bool: true } + end + act[:html_right_column]=if mod.inspect =~/"--no-html-right-column"/ \ + || act[:switch][:off].inspect =~/"html_right_column"|"promo"/ + { bool: false } else { bool: true } end act[:dal]=(cmd =~/m/ \ @@ -478,6 +562,10 @@ module SiSU_Commandline || mod.inspect =~/"--concordance"/) \ ? { bool: true } : { bool: false } + act[:images]=(cmd =~/j/ \ + || mod.inspect =~/"--images"/) \ + ? { bool: true } + : { bool: false } act[:pdf]=(cmd =~/p/ \ || mod.inspect =~/"--pdf"/) \ ? { bool: true } |