diff options
Diffstat (limited to 'src/sisudoc/spine.d')
| -rw-r--r-- | src/sisudoc/spine.d | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/sisudoc/spine.d b/src/sisudoc/spine.d index 9013c3e..9424e02 100644 --- a/src/sisudoc/spine.d +++ b/src/sisudoc/spine.d @@ -97,14 +97,24 @@ string program_name = "spine"; static auto rgx = RgxI(); static auto rgx_y = RgxYaml(); static auto rgx_files = RgxFiles(); + /+ ↓ an action whose output is a file's contents, printed to stdout, turns + this off: the banner would otherwise be part of what it printed. The + round trips do the same by leaving before scope(success) runs, which + they can because they leave early; --po4a-cfg prints from inside + output processing and so says so here instead. Set where the options + are read, below: the banner is declared before they exist. + +/ + bool _run_banner = true; scope(success) { - writefln( - "~ run complete, ok ~ (%s-%s.%s.%s, %s D:%s, %s %s)", - program_name, - _ver.major, _ver.minor, _ver.patch, - __VENDOR__, __VERSION__, - bits, os, - ); + if (_run_banner) { + writefln( + "~ run complete, ok ~ (%s-%s.%s.%s, %s D:%s, %s %s)", + program_name, + _ver.major, _ver.minor, _ver.patch, + __VENDOR__, __VERSION__, + bits, os, + ); + } } scope(failure) { debug(checkdoc) { @@ -166,6 +176,7 @@ string program_name = "spine"; "pdf" : false, "pdf-color-links" : false, "pdf-init" : false, + "po4a-cfg" : false, "pod" : false, "pod2" : false, "serial" : false, @@ -288,6 +299,7 @@ string program_name = "spine"; "pdf", "latex output for pdfs", &opts["pdf"], "pdf-color-links", "mono or color links for pdfs", &opts["pdf-color-links"], "pdf-init", "initialise latex shared files (see latex-header-sty)", &opts["pdf-init"], + "po4a-cfg", "print the po4a configuration for this document", &opts["po4a-cfg"], "pod", "spine (doc reform) pod source content bundled", &opts["pod"], "pod2", "pod with document abstraction (.ssp) bundled", &opts["pod2"], "quiet|q", "output to terminal", &opts["vox_is1"], @@ -359,6 +371,10 @@ string program_name = "spine"; "debug-stages", "debug stages", &opts["debug-stages"], // "sqlite-db-filename", "=[filename].sql.db", &settings["sqlite-db-filename"], ); + /+ ↓ --po4a-cfg prints a file's contents; see the banner above +/ + if (opts["po4a-cfg"]) { + _run_banner = false; + } if (helpInfo.helpWanted) { defaultGetoptPrinter("Some information about the program.", helpInfo.options); } @@ -611,6 +627,9 @@ string program_name = "spine"; @trusted bool ocn_off() { return ((opts["ocn-off"]) || (opts["no-ocn"])) ? true : false; } + @trusted bool po4a_cfg() { + return opts["po4a-cfg"]; + } @trusted bool pod() { return (opts["pod"] || opts["pod2"]) ? true : false; } |
