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

Comments

Projects
None yet
4 participants
@pdobsan
Copy link

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

This comment has been minimized.

Copy link
Member

commented Sep 1, 2015

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

This comment has been minimized.

Copy link
Member

commented Sep 1, 2015

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

@pdobsan

This comment has been minimized.

Copy link
Author

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

Include default flag values in --help
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 snoyberg referenced this issue Mar 25, 2019

Merged

Include default flag values in --help #4653

2 of 2 tasks complete
@snoyberg

This comment has been minimized.

Copy link
Contributor

commented Mar 25, 2019

Added in #4653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.