-
Notifications
You must be signed in to change notification settings - Fork 134
add backend args flag #710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f-f
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joprice thank you for doing this, looks great! Just left some minor comments, it's almost good to go.
src/Spago/CLI.hs
Outdated
| ) | ||
|
|
||
| firstNonEmpty x y = if null x then y else x | ||
| execArgs = firstNonEmpty <$> backendArgs <*> nodeArgs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to pick one? I'd expect we could just merge them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no strong preference. I had it as merge first, but thought that would more surprising than preferring one or the other. For instance, if one script written by one person uses node-args, and another adds backend-args on top, you might expect it to override the first one, since you'd be treating them as equivalent. But, if the semantics of repeating node-args is to combine them, then having both would imply combining for the same reason.
| ( "test" | ||
| , "Test the project with some module, default Test.Main" | ||
| , Test <$> mainModule <*> buildOptions <*> nodeArgs | ||
| , Test <$> mainModule <*> buildOptions <*> execArgs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm now wondering if we should now call the new flag --exec-args or --run-args rather than --backend-args? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I like exec-args better. I guess my variable names betray that.
|
Should I go forward with those two changes - merge instead of override and "exec-args"? |
@joprice sorry for delay, I was travelling yesterday - yes let's go forward with these! |
|
Updated. Let me know if I missed anything |
f-f
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you! 🙂
Description of the change
This allows the more general "backend-args" to be used instead of "node-args", since there are now multiple backends and the flag is not actually specific to node. It addresses #709.
Checklist:
README