How do I pass command line arguments to stack exec
Something like this should work:
stack exec -- myprogram-exe -i myfile.txt
Another way as Michael Snoyman says should be like this:
$(stack exec which foo)
You can also use stack build
with the --exec
flag to build and execute in one command. The arguments to the executable have to be included in the exec argument.
$ stack build --exec "myexecutable arg1 arg2"