mach: sort out CLI arguments / program options #595

Open
opened 2022-10-22 16:00:52 +00:00 by emidoots · 0 comments
emidoots commented 2022-10-22 16:00:52 +00:00 (Migrated from github.com)
  • If one follows the getting started guide, it's not possible to easily modify the build.zig to pass arguments from zig build run -- foobar to your program.
    • i.e. you can't call .addArgs because getInstallStep returns a Step not a RunStep.
    • We cannot return a RunStep, since for WASM targets the step runs wasmserve so you can open in your browser.
    • We may need to expose a separate function like runNative (squirl's suggestion), or come up with a different solution.
    • WASM (browser) targets, and likely also other targets (mobile, VR, etc.) do not really have a concept of CLI flags. We may need to come up with some other form of simple "options" one can pass to their program that works in all these situations nicely.
  • Whatever we come up with, it should have a documentation section on the new machengine.org website: "adding CLI arguments" or similar.
* [ ] If one follows the [getting started guide](https://github.com/hexops/mach-examples#use-mach-engine-in-your-own-project), it's not possible to easily modify the `build.zig` to pass arguments from `zig build run -- foobar` to your program. * i.e. you can't call `.addArgs` because `getInstallStep` returns a `Step` not a `RunStep`. * We cannot return a `RunStep`, since for WASM targets the step runs `wasmserve` so you can open in your browser. * We may need to expose a separate function like `runNative` (squirl's suggestion), or come up with a different solution. * WASM (browser) targets, and likely also other targets (mobile, VR, etc.) do not really have a concept of CLI flags. We may need to come up with some other form of simple "options" one can pass to their program that works in all these situations nicely. * [ ] Whatever we come up with, it should have a documentation section on the new machengine.org website: "adding CLI arguments" or similar.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach#595
No description provided.