-
Notifications
You must be signed in to change notification settings - Fork 841
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
CLI woes with stack config set
?
#2707
Comments
Ah, thanks for reminding why
I suspect that's best for the user—we should just error and explain that the used field is not global. Maybe it should be obvious that When I wrote:
my reasoning was that having an option like |
I agree.
Currently everything that can be configured in The additional options that should be available from A |
Thanks, I stand corrected on discoverability. The only annoyance is you don't learn about |
@mgsloan: What do you think about creating a I think it would also help make it quite clear what options can be configured in a project and which ones are available globally. |
@sjakobi I think that's a great idea! Worth implementing before the next release. Putting this on P0 so that we consider this issue before doing the next release. |
I think the current CLI is fine - the help is available via |
The
--global
flag forstack config set
is intended to cause configuration changes to apply to~/.stack/config.yaml
instead of the configuration of the current project.Because
resolver
like all project configuration options cannot be configured in the global~/.stack/config.yaml
, in #2675 I reimplemented the field names likesystem-ghc
andresolver
as subcommands of which only some take the--global
flag.A downside to this approach is that the
--global
can only be passed in after the field name, so e.g. this command is a syntax error:Alternatively, it would be possible to make the
--global
flag an option to thestack config
orstack config set
commands, which would make other positions of the flag acceptable, but force the code to handle nonsensical commands likestack config set --global resolver lts
elsewhere.A monadic option parser could allow other positions for the
--global
while keepingstack config set --global resolver lts
a syntax error.optparse-applicative
provides some functionality for monadic parsing but it's more difficult to use and more difficult to get a good CLI help text with it.The text was updated successfully, but these errors were encountered: