feat(lang): std.cli exit-code + --json contract helpers [F3.3]
Foundation milestone close — the minimal exit-code / --json contract `dist` relies on, in pure sx (no compiler change). - EX_OK (0) / EX_USAGE (64, sysexits.h) / EX_UNAVAILABLE (70) named constants in std.cli. - exit_ok() / exit_usage() terminators routing through the canonical process.exit(code: u8) — removes the hand-rolled cli_bail_exit `_exit` binding; the unsupported-platform path now uses proc.exit(EX_UNAVAILABLE). - --json read is parsed.json (already parsed by F3.2); documented as the detection point with a stdout-pure / stderr-human convention. - examples/0718-modules-cli-exit-json.sx exercises the contract: json true with --json / false without, EX_USAGE == 64, and a usage path that exits 64 via exit_usage() (expected .exit = 64). - readme.md gains a std.cli command-line-interface subsection.
This commit is contained in:
6
examples/expected/0718-modules-cli-exit-json.stdout
Normal file
6
examples/expected/0718-modules-cli-exit-json.stdout
Normal file
@@ -0,0 +1,6 @@
|
||||
ex-ok-is-0: ok
|
||||
ex-usage-is-64: ok
|
||||
json-set-true: ok
|
||||
json-set-false: ok
|
||||
{"out":"dist"}
|
||||
usage-error-raised: ok
|
||||
Reference in New Issue
Block a user