Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
Main is the whole lg command line: flag registration, argument handling, and every mode the binary supports (eval, run, REPL, nREPL, -c compile, -b bundle, -w wasm). It returns an exit code rather than calling os.Exit itself, so an embedding main stays in control of shutdown.
Two limits worth knowing. Flag parsing uses flag.CommandLine, which is ExitOnError: -h and a malformed flag still terminate the process from inside Main, as they do for any Go command. And Main is meant to be called once per process — option state lives in package variables and is not reset, so a second call inherits the first call's flags.
ver and com are the build metadata the ldflags contract puts on the root package; pass "dev" and "none" when you have none.
A third-party binary is then just:
func main() { os.Exit(cli.Main("dev", "none")) }
with the generated interop packages blank-imported alongside it.
Types ¶
This section is empty.