diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-30 11:06:25 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-30 20:04:53 -0400 |
| commit | 9c4bc48eeaeeee02880177399243535e2149beea (patch) | |
| tree | e26d44c29f845cdc5da2e211267fa1836e816780 /src | |
| parent | options: request absent flag, warn; --strict fails (diff) | |
--version, as an option
--version prints the: version, compiler, and platform, and exits.
(assisted by Claude-Code)
Diffstat (limited to 'src')
| -rw-r--r-- | src/sisudoc/spine.d | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sisudoc/spine.d b/src/sisudoc/spine.d index e1e5d62..baae14c 100644 --- a/src/sisudoc/spine.d +++ b/src/sisudoc/spine.d @@ -230,6 +230,7 @@ string program_name = "spine"; "strict" : false, "theme-dark" : false, "theme-light" : false, + "version" : false, "workon" : false, ]; string[string] settings = [ @@ -373,6 +374,7 @@ string program_name = "spine"; "theme-light", "default light theme", &opts["theme-light"], "verbose|v", "output to terminal", &opts["vox_is3"], "very-verbose", "output to terminal", &opts["vox_is4"], + "version", "print the version of spine and exit", &opts["version"], "workon", "(reserved for some matters under development & testing)", &opts["workon"], "xhtml", "xhtml output", &opts["xhtml"], "config", "=/path/to/config/file/including/filename", &settings["config"], @@ -395,6 +397,17 @@ string program_name = "spine"; if (opts["po4a-cfg"]) { _run_banner = false; } + /+ ↓ --version: the version, and nothing else done. +/ + if (opts["version"]) { + writefln("%s-%s.%s.%s (%s D:%s, %s %s)", + program_name, + _ver.major, _ver.minor, _ver.patch, + __VENDOR__, __VERSION__, + bits, os, + ); + import core.stdc.stdlib : exit; + exit(0); + } /+ ↓ an option getopt did not recognise +/ { string[] _unknown_options |
