From 9c4bc48eeaeeee02880177399243535e2149beea Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 30 Sep 2026 11:06:25 -0400 Subject: --version, as an option --version prints the: version, compiler, and platform, and exits. (assisted by Claude-Code) --- org/spine.org | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'org') diff --git a/org/spine.org b/org/spine.org index 67574f5..cac3a75 100644 --- a/org/spine.org +++ b/org/spine.org @@ -622,6 +622,7 @@ bool[string] opts = [ "strict" : false, "theme-dark" : false, "theme-light" : false, + "version" : false, "workon" : false, ]; #+END_SRC @@ -779,6 +780,7 @@ auto helpInfo = getopt(args, "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"], @@ -801,6 +803,17 @@ auto helpInfo = getopt(args, 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); +} #+END_SRC ***** unrecognized option -- cgit v1.2.3