Behavior
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.
Behavior
A Bend-compiled native binary treats
--helpas a runtime flag. Beforemainruns, the runtime prints its own usage (--threads,--gpu,--gpu-build,--help,--) and exits. The program never sees--helpinIO.args().The same reserved handling applies to
--threads,--gpu, and--gpu-build. Words after--are passed through unchanged, including--help.Minimal example
Build and run:
Request
Prefer one of:
--helpthrough toIO.args()(move runtime help to something like--bend-help), or--helponly when the binary has no program arguments and/or when explicitly requested, and otherwise forward--helpto the program.Goal: a compiled CLI can implement its own
--helpthe way users expect, without requiringhelpas a subcommand or-- --help.