Closed pinkforest closed 1 year ago
Great work on figuring this out! There is also this part when running tests that now needs to receive an optional run
: https://github.com/lunatic-solutions/lunatic/blob/main/src/mode/cargo_test.rs#L15-L18
Can this also be made optional?
I found a better way - let me know if you liked the old better - now it handles --flags proper w/ the power of regex :)
Now it's
$ lunatic --bench
Usage: lunatic run --bench <PATH> [WASM_ARGS]...
$ lunatic --bench target/wasm32-wasi/debug/yaws.wasm
Listening on addr: 127.0.0.1:9999
$ lunatic --dir . target/wasm32-wasi/debug/yaws.wasm
Listening on addr: 127.0.0.1:9999
$ lunatic target/wasm32-wasi/debug/yaws.wasm
Listening on addr: 127.0.0.1:9999
$ lunatic errororor
error: The subcommand 'errororor' wasn't recognized
Usage: lunatic-runtime <COMMAND>
For more information, try '--help'.
$ lunatic --fff errororor
error: unexpected argument '--fff' found
Usage: lunatic <COMMAND>
For more information, try '--help'.
$ lunatic run target/wasm32-wasi/debug/yaws.wasm
Listening on addr: 127.0.0.1:9999
Can this also be made optional?
I adjusted the detection that was out there and now it works in both under cargo test and lunatic run :tada:
This looks good to me. My only worry is that we will need to remember to extend the regex every time we add an additional argument to run
, but this shouldn't be a big issue and I'm going to merge this as is.
remember to extend the regex every time we add an additional argument to run
Could always have a regex with ^- then as no subcommand start with a dash
lunatic run <wasm>
without having to sayrun