You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let compiled binaries pass --help through to IO.args #934
A Bend-compiled native binary treats --help as a runtime flag. Before main runs, the runtime prints its own usage (--threads, --gpu, --gpu-build, --help, --) and exits. The program never sees --help in IO.args().
The same reserved handling applies to --threads, --gpu, and --gpu-build. Words after -- are passed through unchanged, including --help.
Minimal example
# demo.bend
import Base
def main() -> IO(Unit):
do IO<Unit>:
+av : List<&1, String> <- IO.args()
match av:
case Con{h, _t}:
IO.print(h)
case Nil{}:
IO.print("(none)")
Build and run:
bend demo.bend -o bin/demo
bin/demo --help # runtime usage; process exits; demo does not run
bin/demo -- --help # prints: --help
bin/demo hello # prints: hello
Request
Prefer one of:
Pass --help through to IO.args() (move runtime help to something like --bend-help), or
Keep runtime --help only when the binary has no program arguments and/or when explicitly requested, and otherwise forward --help to the program.
Goal: a compiled CLI can implement its own --help the way users expect, without requiring help as a subcommand or -- --help.
Activity
noah-emp commentedon Sep 22, 2026
--bend-help is probably the worse option here, last resort imo if two is too hard
The IO.args note names only --bend-help: the flag list is each lane's…
Compiled binaries pass --help to IO.args; runtime help is --bend-help (…