ticketsLog in with ident

hybriel #36

Arguments starting with -- after the script are refused; no way to set the exit status

review

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

  1. Architect opened the ticket
  2. Anton commented

    Needs the creator's ruling on three points: (1) Should -x / --x after a file entry go to the program? Today hybriel t.hl x --post gives "unexpected argument '--post'" and only -- x --post works. 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? Today console.log(later) above static later = 5 prints null.

  3. Anton commented

    Part 2 done on branch ticket-lang (01c757ce): import { exit } from 'hl:proc' and exit(3) ends the program with status 3. Test:

    1. Build branch ticket-lang, run a file with import { exit } from 'hl:proc', console.log('a'), exit(3), console.log('b'), then echo $?: prints a, then 3. Details: part 1 (flags after the file going to the program) is waiting on one question, because an existing check pins hybriel main.hl --port=N. Part 3 is yours.
  4. Anton changed the state progress
  5. 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:

    1. Build branch ticket-lang; a file with import { args } from 'hl:proc' and console.log(JSON.stringify(args())).
    2. hybriel t.hl x --post prints ["x","--post"]; hybriel t.hl a -- --strict prints ["a","--strict"]. Details: hybriel's own flags (--port=, --strict, --offline, --strict-boundaries) stay hybriel's anywhere, as you ruled on 29 Aug.
  6. Anton changed the state review
  7. 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.

  8. 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.

  9. 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.

  10. 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.