Guidedog 手册 0.6.3
语言
本页内容
Guidedog / 文档 0.6.3

discussion/command

Package command is the discussion command line: dsc and dscc run it on any catalog, and guidedog gds runs it on Guidedog’s own. A Program says which: its name, the renderer that builds, and, for guidedog gds, the prefix and folder it is fixed to. It allocates with context.allocator and never frees, so run it in an arena.

Types

command.Program :: struct

Program is what runs the command line: dsc, dscc, or guidedog gds.

name: string

as the user types it: “dsc”, “dscc”, “guidedog gds”.

version: string

what –version prints.

renderer: ds.Renderer
prefix: string

the only prefix it manages (“gds”), or “” for any.

dir: string

the catalog when –dir is not given, or “” to find it.

tool: string

the option naming the renderer’s program: typst or guidedog.

Procedures

command.run :: proc(program: Program, 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. When memory runs out the command changes no record and ends with exit 3, reported without allocating.

Constants

command.VERSION :: "0.6.3"

VERSION is the version of dsc and dscc, which is Guidedog’s (lib/cli checks it).