Skip to content
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

Defaults for options #893

Closed
pdobsan opened this issue Sep 1, 2015 · 4 comments · Fixed by #4653
Closed

Defaults for options #893

pdobsan opened this issue Sep 1, 2015 · 4 comments · Fixed by #4653

Comments

@pdobsan
Copy link

pdobsan commented Sep 1, 2015

May I suggest a small improvement both of the various documentations and of the help messages provided by stack on the command line. There are many flags/config options of the form --something/--no-something. It would be nice to always indicate which one is the default.

Or in the case when such a choice is dependent of other factors, try to give some explanation.

@chrisdone
Copy link
Member

I think if we mirror the library-profiling output, via the boolFlags combinator we get a good result:

Example:

libProfiling =
  boolFlags False
            "library-profiling"
            "library profiling for TARGETs and all its dependencies"
            idm

=>

  --library-profiling      Enable library profiling for TARGETs and all its
                           dependencies (--no-library-profiling to disable)

Although this is only on master, if you have an older release it shows two separate flags.

@chrisdone
Copy link
Member

Although probably some text from boolFlags to say "disabled by default" would enhance that message.

@pdobsan
Copy link
Author

pdobsan commented Sep 1, 2015

Combining the help messages for the alternatives is good.
Even the no-XYZ explanation could be spared if the --no-XYZ is consistently used everywhere. So that could be explained only once in general terms.
Hmm, maybe shorting the flag description is not so simple if the default is no-XYZ.

For any case, as you also note, defaults should be made clear.

@borsboom borsboom added this to the Options parsing milestone Sep 5, 2015
@borsboom borsboom modified the milestones: Options parsing, P3 Sep 12, 2015
snoyberg added a commit that referenced this issue Mar 25, 2019
Fixes #893. The implementation strategy is to replace `First Bool` with
either a `First True` or `First False` so that we can use the type to
ensure we display the correct default. This results in a lot of changes
to the codebase, but they are all type directed.

Alternatively, we could introduce a typeclass here to reduce some
boilerplate, but I prefer the more explicit approach.
@snoyberg
Copy link
Contributor

Added in #4653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants