diff options
Diffstat (limited to 'org/spine.org')
| -rw-r--r-- | org/spine.org | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/org/spine.org b/org/spine.org index a0f0570..7c62cd0 100644 --- a/org/spine.org +++ b/org/spine.org @@ -350,6 +350,7 @@ string program_name = "spine"; #+NAME: imports_spine #+BEGIN_SRC d import std.algorithm; +import std.array; import std.datetime; import std.getopt; import std.file; @@ -630,7 +631,7 @@ string[string] settings = [ "output" : "", "pod-compression" : "", "ssp-round-trip" : "", - "db-round-trip" : "", + "ocda-db-round-trip" : "", "ocda-verify" : "", "abstraction-source" : "", "www-http" : "", @@ -661,7 +662,10 @@ string[string] settings = [ auto helpInfo = getopt(args, std.getopt.config.passThrough, "abstraction", "document abstraction", &opts["abstraction"], - "abstraction-db", "document abstraction (write ocda.db sqlite file)", &opts["abstraction-db"], + /+ ↓ undocumented alias of --ocda-db, which names the artefact it writes + kept working but filtered out of help listing + +/ + "abstraction-db", "", &opts["abstraction-db"], "allow-downloads", "allow a url argument to be fetched (zip or db)", &opts["allow-downloads"], "assert", "set optional assertions on", &opts["assertions"], "cgi-bin-root", "path to cgi-bin directory", &settings["cgi-bin-root"], @@ -702,7 +706,7 @@ auto helpInfo = getopt(args, "odt", "open document format text", &opts["odt"], "output", "=/path/to/output/dir specify where to place output", &settings["output"], "ssp-round-trip", "=/path/to/file.ssp read a .ssp back and re-emit it on stdout", &settings["ssp-round-trip"], - "db-round-trip", "=/path/to/file.ocda.db read it back and emit .ssp on stdout", &settings["db-round-trip"], + "ocda-db-round-trip", "=/path/to/file.ocda.db read it back and emit .ssp on stdout", &settings["ocda-db-round-trip"], "ocda-verify", "=/path/to/file.ocda.db does this spine still make this abstraction from the markup it carries", &settings["ocda-verify"], "no-verify", "do not check carried markup against the abstraction it was built with", &opts["no-verify"], "abstraction-source", "=/path/to/(.sst|pod|.ssp|.ocda.db) identify it, and load it if it is an abstraction", &settings["abstraction-source"], @@ -795,6 +799,11 @@ if (opts["po4a-cfg"]) { #+NAME: spine_args_get_help #+BEGIN_SRC d if (helpInfo.helpWanted) { + /+ ↓ the undocumented alias is registered so that it still works, and is + not listed, so that --ocda-db is the one flag the help offers + +/ + auto _options_documented + = helpInfo.options.filter!(o => o.optLong != "--abstraction-db").array; defaultGetoptPrinter( "spine: structure, parse, publish and search document collections.\n" ~ "\n" @@ -809,7 +818,7 @@ if (opts["po4a-cfg"]) { ~ " <doc>.ocda.db the abstraction, as sqlite\n" ~ "\n" ~ "A url is fetched only with --allow-downloads.\n", - helpInfo.options + _options_documented ); /+ ↓ the contract, after the options: what an artefact carries and what can be done with it. It belongs in --help because it is the answer @@ -922,7 +931,7 @@ if (settings["ssp-round-trip"].length > 0) { .ssp on stdout. compared against the .ssp for the same document, this says whether the two artefacts really do carry the same thing +/ -if (settings["db-round-trip"].length > 0) { +if (settings["ocda-db-round-trip"].length > 0) { import sisudoc.ocda.abstraction.ssp; import sisudoc.ocda.abstraction.db_in; mixin spineAbstractionDbRead; @@ -941,7 +950,7 @@ if (settings["db-round-trip"].length > 0) { _rt_lang = _langs[0]; } } - auto _doc = dbReadFile(settings["db-round-trip"], _rt_lang); + auto _doc = dbReadFile(settings["ocda-db-round-trip"], _rt_lang); if (_doc.format.length == 0 && _doc.section_order.length == 0) { import core.stdc.stdlib : exit; stdout.flush; |
