hybriel
Arguments starting with -- after the script are refused; no way to set the exit status
opened by Architect · assigned to Caramboleyo
opened · updated
Found in mission 015 (scheduler): bin/hybriel t.hl x --post -> 'unexpected argument --post' (workaround: bin/hybriel t.hl -- x --post). hl:proc has no exit(n): a refusal still exits 0, so scripts can't signal failure to the shell. Also: a static used before its declaration in the same file reads as null without an error.
History
Architect opened the ticket Anton commented Needs the creator's ruling on three points: (1) Should
-x/--xafter a file entry go to the program? Todayhybriel t.hl x --postgives "unexpected argument '--post'" and only-- x --postworks. The 17 Sep ruling only says positionals. (2) Should hl:proc get exit(n)? Today there is none; hlError exits 1. (3) Should reading a member before its declaration be a located error? Todayconsole.log(later)abovestatic later = 5prints null.Anton commented Part 2 done on branch ticket-lang (01c757ce):
import { exit } from 'hl:proc'andexit(3)ends the program with status 3. Test:- Build branch ticket-lang, run a file with
import { exit } from 'hl:proc',console.log('a'),exit(3),console.log('b'), thenecho $?: prints a, then 3. Details: part 1 (flags after the file going to the program) is waiting on one question, because an existing check pinshybriel main.hl --port=N. Part 3 is yours.
- Build branch ticket-lang, run a file with
Anton changed the state progress Anton commented Part 1 done on branch ticket-lang (40ddd099): after a file entry, every argument that is not one of hybriel's own flags goes to the program, flags included; after
--everything does. Test:- Build branch ticket-lang; a file with
import { args } from 'hl:proc'andconsole.log(JSON.stringify(args())). hybriel t.hl x --postprints ["x","--post"];hybriel t.hl a -- --strictprints ["a","--strict"]. Details: hybriel's own flags (--port=, --strict, --offline, --strict-boundaries) stay hybriel's anywhere, as you ruled on 29 Aug.
- Build branch ticket-lang; a file with
Anton changed the state review Anton commented Creator ruling (chat, 2026-09-27): framework options like --port and --offline are not language arguments. hybriel passes every argument after the entry file unchanged to the program, and hl:web reads its own --port and --offline. That also covers this ticket's first half. Being done after 326 rung 7.
Anton commented Correction to my last comment: --offline stays in hybriel (it forbids fetching missing pinned packages; HL_OFFLINE=1 is the same). Only --port moves to hl:web.
Anton commented Creator rule:
hybriel [runtime flags] <file> [app args]. Everything before the file name is for the runtime (--strict, --offline, …); everything after it goes unchanged to the program (e.g. --port, which hl:web reads). So arguments starting with -- after the script are the app's.Anton commented Done on master (8eeffde9).
hybriel [runtime flags] <entry> [program args]: everything after the entry reaches args() unchanged,--included. hl:web reads --port from args(). Realm joining is moving to--realm=<name>before the entry. The exit-status half of this ticket is still open.
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.