cli¶
Package cli is the guidedog command: run parses a command line, does what it asks, and returns the exit status. It is the command’s whole surface; everything else here is private. It allocates with context.allocator and never frees, so the command runs it in an arena (cmd/guidedog), which frees everything at once.
Procedures
- cli.run :: proc(args: []string) -> int¶
-
run runs the command line args (without the program name) and returns the exit status: 0 on success, and on failure the status the problem names, after reporting it on standard error. It allocates with context.allocator, an arena the caller frees, through a host.Guard: when that allocator refuses memory, the command changes no record and ends with host.memory (exit 3), reported without allocating.
- cli.version_text :: proc(buffer: []u8) -> string¶
-
version_text writes into buffer what
guidedog --versionprints before the Typst compiler it finds, the versions built into the program, and returns it. It allocates nothing, so the crash report is prepared with it at start (cmd/guidedog).
Constants
- cli.FULL_VERSION :: VERSION + VERSION_SUFFIX¶
-
FULL_VERSION is what the command prints as its version: VERSION and VERSION_SUFFIX.
- cli.LICENSE_NOTICE¶
-
LICENSE_NOTICE is what
guidedog --licensesprints before the notices of the libraries linked in.
- cli.VERSION :: "0.2.0"¶
-
VERSION is the Guidedog release this program belongs to, the one version `guidedog --version`,
guidedog --help, and the crash report name. The file VERSION at the repository root holds the same text for release tooling, and version_test.odin fails when the two differ. The Guidedoc engine’s own version (core.VERSION) and document schema are reported beside it; they are separate because programs embed the engine without this command.
- cli.VERSION_SUFFIX :: #config(GUIDEDOG_VERSION_SUFFIX, "")¶
-
VERSION_SUFFIX is build metadata appended to VERSION, for development builds such as -define:GUIDEDOG_VERSION_SUFFIX=+3fe1d8a (Semantic Versioning’s “+” form). A release build has none.