-
Notifications
You must be signed in to change notification settings - Fork 843
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
Deprecate stack-setup-yaml
#2703
Conversation
Please see these messages for a query related to me not killing your Travis runner time. |
Deprecating |
Thanks for tips @Blaisorblade but I am a little confused. Regarding what the
Not sure how I can achieve this with a smart constructor given I need a new field to represent both? Or should the |
I'd have said expected Disclaimer: I haven't tried this out, but at least here's what I imagined—with a bit more detail added. Feel free to ignore tips that don't actually make sense (I'm also learning optparse-applicative 😉 ).
No, deprecations are usually announced, just like in API—how do you study existing scripts otherwise? I also wouldn't know how to achieve that.
Well, why a new field? Again, that sounds bad. What I had in mind was (ignoring other fields): setupCmdOpts :: Maybe String -> Maybe String -> SetupCmdOpts
setupCmdOpts stackSetupYaml setupInfoYaml = SetupCmdOpts (stackSetupYaml <|> setupInfoYaml <|> Just defaultStackSetupYaml).
setupCmdOpts <$> ... <*> ... I wondered how to build parsers for Option String though, but that seems doable through And to get the right output, it's probably best to leave the default in setupCmdOpts :: Maybe String -> String -> SetupCmdOpts
setupCmdOpts stackSetupYaml setupInfoYaml = SetupCmdOpts (stackSetupYaml <|> setupInfoYaml).
setupParser = setupCmdOpts
<$> OA.optional (OA.strOption
( OA.long "stack-setup-yaml"
<> OA.metavar "URL"
<> OA.help "DEPRECATED in favour of 'setup-info-yaml'"))
<*> OA.strOption
( OA.long "setup-info-yaml"
<> OA.metavar "URL"
<> OA.help "Alternate URL or absolute file path for various tools stack relies on (GHC, msys2)"
<> OA.value defaultStackSetupYaml
<> OA.showDefault ) |
Forgot: the above doesn't allow per se a runtime warning. If needed we might need to store a boolean flag in |
BTW, what I proposed is more complicated than having separate fields for the options. The problem with having two fields is making sure they're not treated differently by the command—so at some point Generally speaking, the option parser is IMHO still the best place, but having two fields in a new type Finally: |
Thanks for this brain dump!!! I will work towards something useful :) |
@Blaisorblade Is skipping the run time warning acceptable? Given that |
Not 100% sure on that, that's why I asked in #2647. I just realized that you answered me... |
😀 |
LGTM, thanks! |
Closes #2647. Hope that covers it.