diff options
Diffstat (limited to 'src/sdp/sdp.d')
-rwxr-xr-x | src/sdp/sdp.d | 205 |
1 files changed, 91 insertions, 114 deletions
diff --git a/src/sdp/sdp.d b/src/sdp/sdp.d index 50df3f2..20b2228 100755 --- a/src/sdp/sdp.d +++ b/src/sdp/sdp.d @@ -62,17 +62,13 @@ void main(string[] args) { "concordance" : false, "debug" : false, "digest" : false, - "docbook" : false, "epub" : false, "html" : false, "html-seg" : false, "html-scroll" : false, "manifest" : false, "ocn" : true, - "odt" : false, - "pdf" : false, - "postgresql" : false, - "qrcode" : false, + "quiet" : false, "sisupod" : false, "source" : false, "sqlite-discrete" : false, @@ -84,9 +80,8 @@ void main(string[] args) { "sqlite-update" : false, "text" : false, "verbose" : false, + "very-verbose" : false, "xhtml" : false, - "xml-dom" : false, - "xml-sax" : false, "section_toc" : true, "section_body" : true, "section_endnotes" : true, @@ -105,52 +100,46 @@ void main(string[] args) { ]; auto helpInfo = getopt(args, std.getopt.config.passThrough, - "abstraction", "--abstraction document abstraction ", &opts["abstraction"], - "assert", "--assert set optional assertions on", &opts["assertions"], - "concordance", "--concordance file for document", &opts["concordance"], - "debug", "--debug", &opts["debug"], - "digest", "--digest hash digest for each object", &opts["digest"], - "docbook", "--docbook process docbook output", &opts["docbook"], - "epub", "--epub process epub output", &opts["epub"], - "html", "--html process html output", &opts["html"], - "html-seg", "--html-seg process html output", &opts["html-seg"], - "html-scroll", "--html-seg process html output", &opts["html-scroll"], - "manifest", "--manifest process manifest output", &opts["manifest"], - "ocn", "--ocn object cite numbers (default)", &opts["ocn"], - "odf", "--odf process odf:odt output", &opts["odt"], - "odt", "--odt process odf:odt output", &opts["odt"], - "pdf", "--pdf process pdf output", &opts["pdf"], - "pg", "--pg process postgresql output", &opts["postgresql"], - "postgresql", "--postgresql process postgresql output", &opts["postgresql"], - "qrcode", "--qrcode with document metadata", &opts["qrcode"], - "sisupod", "--sisupod sisupod source content bundled", &opts["sisupod"], - "source", "--source markup source text content", &opts["source"], - "sqlite-discrete", "--sqlite process discrete sqlite output", &opts["sqlite-discrete"], - "sqlite-db-create", "--sqlite-db-create create db, create tables", &opts["sqlite-db-create"], - "sqlite-db-drop", "--sqlite-db-drop drop tables & db", &opts["sqlite-db-drop"], - "sqlite-db-recreate", "--sqlite-db-recreate create db, create tables", &opts["sqlite-db-recreate"], - "sqlite-delete", "--sqlite process sqlite output", &opts["sqlite-delete"], - "sqlite-insert", "--sqlite process sqlite output", &opts["sqlite-insert"], - "sqlite-update", "--sqlite process sqlite output", &opts["sqlite-update"], - "text", "--text process text output", &opts["text"], - "txt", "--txt process text output", &opts["text"], - "verbose|v", "--verbose output to terminal", &opts["verbose"], - "xhtml", "--xhtml process xhtml output", &opts["xhtml"], - "xml-dom", "--xml-dom process xml dom output", &opts["xml-dom"], - "xml-sax", "--xml-sax process xml sax output", &opts["xml-sax"], - "section-toc", "--section-toc process table of contents (default)", &opts["section_toc"], - "section-body", "--section-body process document body (default)", &opts["section_body"], - "section-endnotes", "--section-endnotes process document endnotes (default)", &opts["section_endnotes"], - "section-glossary", "--section-glossary process document glossary (default)", &opts["section_glossary"], - "section-biblio", "--section-biblio process document biblio (default)", &opts["section_biblio"], - "section-bookindex", "--section-bookindex process document bookindex (default)", &opts["section_bookindex"], - "section-blurb", "--section-blurb process document blurb (default)", &opts["section_blurb"], - "backmatter", "--section-backmatter process document backmatter (default)", &opts["backmatter"], - "skip-output", "--skip-output", &opts["skip-output"], - "output-dir", "--output-dir=[dir path]", &settings["output-dir"], - "site-config-dir", "--site-config-dir=[dir path]", &settings["site-config-dir"], - "sqlite-filename", "--sqlite-filename=[filename].sqlite", &settings["sqlite-filename"], - "lang", "--lang=[lang code e.g. =en or =en,es]", &settings["lang"], + "abstraction", "--abstraction document abstraction ", &opts["abstraction"], + "assert", "--assert set optional assertions on", &opts["assertions"], + "concordance", "--concordance file for document", &opts["concordance"], + "debug", "--debug", &opts["debug"], + "digest", "--digest hash digest for each object", &opts["digest"], + "epub", "--epub process epub output", &opts["epub"], + "html", "--html process html output", &opts["html"], + "html-seg", "--html-seg process html output", &opts["html-seg"], + "html-scroll", "--html-seg process html output", &opts["html-scroll"], + "manifest", "--manifest process manifest output", &opts["manifest"], + "ocn", "--ocn object cite numbers (default)", &opts["ocn"], + "quiet", "--quiet output to terminal", &opts["quiet"], + "sisupod", "--sisupod sisupod source content bundled", &opts["sisupod"], + "source", "--source markup source text content", &opts["source"], + "sqlite-discrete", "--sqlite process discrete sqlite output", &opts["sqlite-discrete"], + "sqlite-db-create", "--sqlite-db-create create db, create tables", &opts["sqlite-db-create"], + "sqlite-db-drop", "--sqlite-db-drop drop tables & db", &opts["sqlite-db-drop"], + "sqlite-db-recreate", "--sqlite-db-recreate create db, create tables", &opts["sqlite-db-recreate"], + // "sqlite-db-populate", "--sqlite-db-populate create db & tables, insert specified", &opts["sqlite-db-populate"], + "sqlite-delete", "--sqlite process sqlite output", &opts["sqlite-delete"], + "sqlite-insert", "--sqlite process sqlite output", &opts["sqlite-insert"], + "sqlite-update", "--sqlite process sqlite output", &opts["sqlite-update"], + "text", "--text process text output", &opts["text"], + "txt", "--txt process text output", &opts["text"], + "verbose|v", "--verbose output to terminal", &opts["verbose"], + "very-verbose", "--very-verbose output to terminal", &opts["very-verbose"], + "xhtml", "--xhtml process xhtml output", &opts["xhtml"], + "section-toc", "--section-toc process table of contents (default)", &opts["section_toc"], + "section-body", "--section-body process document body (default)", &opts["section_body"], + "section-endnotes", "--section-endnotes process document endnotes (default)", &opts["section_endnotes"], + "section-glossary", "--section-glossary process document glossary (default)", &opts["section_glossary"], + "section-biblio", "--section-biblio process document biblio (default)", &opts["section_biblio"], + "section-bookindex", "--section-bookindex process document bookindex (default)", &opts["section_bookindex"], + "section-blurb", "--section-blurb process document blurb (default)", &opts["section_blurb"], + "backmatter", "--section-backmatter process document backmatter (default)", &opts["backmatter"], + "skip-output", "--skip-output", &opts["skip-output"], + "output-dir", "--output-dir=[dir path]", &settings["output-dir"], + "site-config-dir", "--site-config-dir=[dir path]", &settings["site-config-dir"], + "sqlite-filename", "--sqlite-filename=[filename].sqlite", &settings["sqlite-filename"], + "lang", "--lang=[lang code e.g. =en or =en,es]", &settings["lang"], ); if (helpInfo.helpWanted) { defaultGetoptPrinter("Some information about the program.", helpInfo.options); @@ -168,41 +157,45 @@ void main(string[] args) { auto digest() { return opts["digest"]; } - auto docbook() { - return opts["docbook"]; - } auto epub() { return opts["epub"]; } auto html() { - bool _is; - if ( + bool _is = ( opts["html"] || opts["html-seg"] || opts["html-scroll"] - ) { - _is = true; - } else { _is = false; } + ) + ? true + : false; return _is; } auto html_seg() { - bool _is; - if ( + bool _is = ( opts["html"] || opts["html-seg"] - ) { - _is = true; - } else { _is = false; } + ) + ? true + : false; return _is; } auto html_scroll() { - bool _is; - if ( + bool _is = ( + opts["html"] + || opts["html-scroll"] + ) + ? true + : false; + return _is; + } + auto html_stuff() { + bool _is = ( opts["html"] || opts["html-scroll"] - ) { - _is = true; - } else { _is = false; } + || opts["html-seg"] + ) + ? true + : false; return _is; } auto manifest() { @@ -211,17 +204,8 @@ void main(string[] args) { auto ocn() { return opts["ocn"]; } - auto odt() { - return opts["odt"]; - } - auto pdf() { - return opts["pdf"]; - } - auto postgresql() { - return opts["postgresql"]; - } - auto qrcode() { - return opts["qrcode"]; + auto quiet() { + return opts["quiet"]; } auto sisupod() { return opts["sisupod"]; @@ -233,23 +217,21 @@ void main(string[] args) { return opts["sqlite-discrete"]; } auto sqlite_db_drop() { - bool _is; - if ( + bool _is = ( opts["sqlite-db-recreate"] || opts["sqlite-db-drop"] - ) { - _is = true; - } else { _is = false; } + ) + ? true + : false; return _is; } auto sqlite_db_create() { - bool _is; - if ( + bool _is = ( opts["sqlite-db-recreate"] || opts["sqlite-db-create"] - ) { - _is = true; - } else { _is = false; } + ) + ? true + : false; return _is; } auto sqlite_insert() { @@ -265,17 +247,20 @@ void main(string[] args) { return opts["text"]; } auto verbose() { - return opts["verbose"]; + bool _is = ( + opts["verbose"] + || opts["very-verbose"] + ) + ? true + : false; + return _is; + } + auto very_verbose() { + return opts["very-verbose"]; } auto xhtml() { return opts["xhtml"]; } - auto xml_dom() { - return opts["xml-dom"]; - } - auto xml_sax() { - return opts["xml-sax"]; - } auto section_toc() { return opts["section_toc"]; } @@ -313,29 +298,21 @@ void main(string[] args) { return settings["sqlite-filename"]; } auto abstraction() { - bool _is; - if ( + bool _is = ( opts["abstraction"] || concordance - || docbook || epub || html || manifest - || odt - || pdf - || postgresql - || qrcode || sisupod || source || sqlite_discrete || sqlite_delete || sqlite_insert || sqlite_update - || text - || xhtml - ) { - _is = true; - } else { _is = false; } + ) + ? true + : false; return _is; } } @@ -411,7 +388,7 @@ void main(string[] args) { _manifests ~= _manifest_matter; } } else if (arg.match(rgx.src_pth_zip)) { - // fns_src ~= arg; // gather input markup source file names for processing + // fns_src ~= arg; // gather input markup source file names for processing } else { // anything remaining, unused arg_unrecognized ~= " " ~ arg; } @@ -429,7 +406,7 @@ void main(string[] args) { foreach(manifest; _manifests[1..$]) { if (!empty(manifest.src.filename)) { scope(success) { - debug(checkdoc) { + if (!(_opt_action.quiet)) { writefln( "%s\n%s", "~ document complete, ok ~", @@ -483,7 +460,7 @@ void main(string[] args) { } } scope(exit) { - debug(checkdoc) { + if (!(_opt_action.quiet)) { writefln( "processed file: %s", manifest.src.filename |