From edd89902036bde18c91031470e19c871a182cf6d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Oct 2013 23:40:45 -0400 Subject: v5: options & downstream, more use of opt.act instead of opt.cmd * opt.act.*.set==:on instead of opt.cmd =~/\S/ --- lib/sisu/v5/sysenv.rb | 99 ++++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 48 deletions(-) (limited to 'lib/sisu/v5/sysenv.rb') diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb index 4de45fd0..b23b7f80 100644 --- a/lib/sisu/v5/sysenv.rb +++ b/lib/sisu/v5/sysenv.rb @@ -2977,88 +2977,91 @@ WOK if @md \ and defined? @md.fn \ and @md.fn # used for by_language_code? - if @md.opt.cmd =~ /[hH]/ + if @md.opt.act[:html][:set]==:on #% --html, -h -H ft << @md.fn[:html] end - if @md.opt.cmd =~ /w/ \ - and @md.opt.cmd !~ /[hH]/ + if @md.opt.act[:concordance][:set]==:on #% --concordance, -w ft << @md.fn[:concordance] end - if @md.opt.cmd =~ /y/ \ - and @md.opt.cmd !~ /[hH]/ + if @md.opt.act[:manifest][:set]==:on #% --manifest, -y ft << @md.fn[:manifest] end - if @md.opt.cmd =~ /[at]/; ft << @md.fn[:plain] + if @md.opt.act[:txt][:set]==:on #% --txt, -t -a + ft << @md.fn[:plain] end - if @md.opt.cmd =~ /b/; ft << @md.fn[:xhtml] + if @md.opt.act[:xhtml][:set]==:on #% --xhtml, -b xhtml + ft << @md.fn[:xhtml] end - if @md.opt.cmd =~ /e/; ft << @md.fn[:epub] + if @md.opt.act[:epub][:set]==:on #% --epub, -e + ft << @md.fn[:epub] end - if @md.opt.cmd =~ /g/; ft << @md.fn[:wiki] + if @md.opt.act[:manpage][:set]==:on #% --manpage, -i + ft << @md.fn[:manpage] end - if @md.opt.cmd =~ /i/; ft << @md.fn[:manpage] + if @md.opt.act[:hash_digests][:set]==:on #% --hash-digests, -N digest tree + ft << @md.fn[:digest] end - if @md.opt.cmd =~ /N/; ft << @md.fn[:digest] + if @md.opt.act[:odt][:set]==:on #% --odt, -o opendocument + ft << @md.fn[:odf] end - if @md.opt.cmd =~ /o/; ft << @md.fn[:odf] + if @md.opt.act[:pdf][:set]==:on #% --pdf-l --pdf, -p latex/ texpdf + ft << @md.fn[:pdf_l] << @md.fn[:pdf_p] end - if @md.opt.cmd =~ /O/; ft << @md.fn[:oai_pmh] + if @md.opt.act[:share_source][:set]==:on + ft << @md.fns end - if @md.opt.cmd =~ /p/; ft << @md.fn[:pdf_l] << @md.fn[:pdf_p] + if @md.opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod + ft << @md.fn[:sisupod] end - if @md.opt.cmd =~ /s/; ft << @md.fns + if @md.opt.act[:xml_sax][:set]==:on #% --xml-sax, -x xml sax type + ft << @md.fn[:sax] end - if @md.opt.cmd =~ /S/; ft << @md.fn[:sisupod] << '.kdi' - end - if @md.opt.cmd =~ /x/; ft << @md.fn[:sax] - end - if @md.opt.cmd =~ /X/; ft << @md.fn[:dom] - end - if @md.opt.cmd =~ /G/; ft << @md.fn[:pot] + if @md.opt.act[:xml_dom][:set]==:on #% --xml-dom, -X xml dom type + ft << @md.fn[:dom] end @fnb=@md.fnb else # still needed where/when param is not parsed - if @opt.cmd =~ /[hH]/; ft << '.html' << '.html.??' + if @opt.act[:html][:set]==:on #% --html, -h -H + ft << '.html' << '.html.??' end - if @opt.cmd =~ /w/ \ - and @opt.cmd !~ /[hH]/ + if @opt.act[:concordance][:set]==:on #% --concordance, -w ft << 'concordance.html' << '??.concordance.html' << 'concordance.??.html' end - if @opt.cmd =~ /y/ \ - and @opt.cmd !~ /[hH]/ + if @opt.act[:manifest][:set]==:on #% --manifest, -y ft << 'sisu_manifest.html' << '??.sisu_manifest.html' << 'sisu_manifest.??.html' end - if @opt.cmd =~ /a/; ft << 'plain.txt' << '??.plain.txt' << 'plain.??.txt' - end - if @opt.cmd =~ /b/; ft << 'scroll.xhtml' << '??.scroll.xhtml' << 'scroll.??.xhtml' - end - if @opt.cmd =~ /e/; ft << @fnb << '.epub' - end - if @opt.cmd =~ /g/; ft << 'wiki.txt' << '??.wiki.txt' << 'wiki.??.txt' - end - if @opt.cmd =~ /i/; ft << '.1' << '??.man.1' << 'man.??.1' - end - if @opt.cmd =~ /N/; ft << 'digest.txt' << '??.digest.txt' << 'digest.??.txt' + if @opt.act[:txt][:set]==:on #% --txt, -t -a + ft << 'plain.txt' << '??.plain.txt' << 'plain.??.txt' end - if @opt.cmd =~ /o/; ft << 'opendocument.odt' << '??.opendocument.odt' << 'opendocument.??.odt' + if @opt.act[:xhtml][:set]==:on #% --xhtml, -b xhtml + ft << 'scroll.xhtml' << '??.scroll.xhtml' << 'scroll.??.xhtml' end - if @opt.cmd =~ /O/; ft << 'oai_pmh.xml' + if @opt.act[:epub][:set]==:on #% --epub, -e + ft << @fnb << '.epub' end - if @opt.cmd =~ /p/; ft << 'landscape.pdf' << 'portrait.pdf' << '.pdf' + if @opt.act[:manpage][:set]==:on #% --manpage, -i + ft << '.1' << '??.man.1' << 'man.??.1' end - if @opt.cmd =~ /s/; ft << '.sst' << '.ssi' << '.ssm' + if @opt.act[:hash_digests][:set]==:on #% --hash-digests, -N digest tree + ft << 'digest.txt' << '??.digest.txt' << 'digest.??.txt' end - if @opt.cmd =~ /S/; ft << '.zip' << '.kdi' + if @opt.act[:odt][:set]==:on #% --odt, -o opendocument + ft << 'opendocument.odt' << '??.opendocument.odt' << 'opendocument.??.odt' end - if @opt.cmd =~ /x/; ft << 'sax.xml' << '??.sax.xml' << 'sax.??.xml' + if @opt.act[:pdf][:set]==:on #% --pdf-l --pdf, -p latex/ texpdf + ft << 'landscape.pdf' << 'portrait.pdf' << '.pdf' end - if @opt.cmd =~ /X/; ft << 'dom.xml' << '??.dom.xml' << 'dom.??.xml' + if @opt.act[:share_source][:set]==:on + ft << '.sst' << '.ssi' << '.ssm' end - if @opt.mod.inspect =~ /sxm|sxs|xml/; ft << @fnb << '.sxs.xml' + if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod + ft << '.zip' end - if @opt.mod.inspect =~ /sxd/; ft << @fnb << '.sxd.xml' + if @opt.act[:xml_sax][:set]==:on #% --xml-sax, -x xml sax type + ft << 'sax.xml' << '??.sax.xml' << 'sax.??.xml' end - if @opt.mod.inspect =~ /sxn/; ft << @fnb << '.sxn.xml' + if @opt.act[:xml_dom][:set]==:on #% --xml-dom, -X xml dom type + ft << 'dom.xml' << '??.dom.xml' << 'dom.??.xml' end end ft=ft.uniq -- cgit v1.2.3