aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/spine.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/spine.org')
-rw-r--r--org/spine.org33
1 files changed, 26 insertions, 7 deletions
diff --git a/org/spine.org b/org/spine.org
index cef324a..5a54d31 100644
--- a/org/spine.org
+++ b/org/spine.org
@@ -325,6 +325,14 @@ enum dAM { abstraction, matters }
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;
#+END_SRC
*** scope (run complete) :scope:
@@ -332,13 +340,15 @@ static auto rgx_files = RgxFiles();
#+NAME: spine_init_scope
#+BEGIN_SRC d
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) {
@@ -410,6 +420,7 @@ bool[string] opts = [
"pdf" : false,
"pdf-color-links" : false,
"pdf-init" : false,
+ "po4a-cfg" : false,
"pod" : false,
"pod2" : false,
"serial" : false,
@@ -546,6 +557,7 @@ auto helpInfo = getopt(args,
"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"],
@@ -617,6 +629,10 @@ auto helpInfo = getopt(args,
"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);
}
@@ -882,6 +898,9 @@ struct OptActions {
@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;
}