andyarvanitis / purescript-native

A native compiler backend for PureScript (via C++ or Golang)
http://purescript.org
Other
632 stars 40 forks source link

pass arguments to run #67

Open joprice opened 4 years ago

joprice commented 4 years ago

This may be a spago limitation, but I expected to be able to pass flags to spago run that would get forwarded to the binary. Instead, I have to run spago build and then run the binary directly with the args.

While trying this, I also discovered spago's --node-args, which maybe should be renamed --backend-args, since it works to send arguments to the psgo process as well: spago run --node-args "--version"

andyarvanitis commented 4 years ago

Seems like a good suggestion (renaming it), but it would of course be something to request from the spago folks directly.

joprice commented 3 years ago

I opened an issue for the rename, but as for passing the args, I assume this backend needs to change to support something like a separator --, an args flag, or just passing the trailing args on to the process?

For example, running

spago run --node-args "--flag flag-value" --verbose

results in calling

psgo --run Main.main --flag flag-value