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

User confusion over help messages not being colored, despite color being enabled #2806

Closed
epage opened this issue Oct 4, 2021 · 6 comments · Fixed by #2845
Closed

User confusion over help messages not being colored, despite color being enabled #2806

epage opened this issue Oct 4, 2021 · 6 comments · Fixed by #2845
Labels
C-enhancement Category: Raise on the bar on expectations M-breaking-change Meta: Implementing or merging this will introduce a breaking change.
Milestone

Comments

@epage
Copy link
Member

epage commented Oct 4, 2021

Rust Version

1.55.0

Affected Version of clap

v3.0.0-beta.4

Expected Behavior Summary

When the color feature is enabled, all coloring is done

Actual Behavior Summary

Users have to know that the ColoredHelp setting exists and set it

Context

This came up when discussing clap's defaults. In addition being a very popular setting among clap CLIs, a user reported

I recently started using clap, and it took a bit to comprehend help messages were not coloured despite the color feature being the default. Lots of head scratching followed by "really?".

I understand the potential argument against having any colourisation by default (ie not a default feature), but regardless of the feature being default or not, colourisation should be the default when the feature is enabled.

Depending on what the motivation for this flag existing, we should either

  • Remove it completely and always color help when color is on
  • Change the default (and possibly rename to reflect that changed behavior)
@epage epage added C-bug Category: Updating dependencies M-breaking-change Meta: Implementing or merging this will introduce a breaking change. C: colorizing labels Oct 4, 2021
@epage epage added this to the 4.0 milestone Oct 4, 2021
@joshtriplett
Copy link
Contributor

I completely agree: if you have the color feature enabled, you should get color automatically by default unless you disable it.

People can always disable ColoredHelp if they don't want it, or disable the color feature entirely to not get color anywhere.

@pksunkara
Copy link
Member

@epage Do you have a design for this if we want to get this into v3?

@pksunkara pksunkara added C-enhancement Category: Raise on the bar on expectations and removed C-bug Category: Updating dependencies labels Oct 9, 2021
@epage
Copy link
Member Author

epage commented Oct 9, 2021

While I want to fix our defaults, I don't think this meets the minimum bar for the 3.0 milestone. Whatever the fix will be, will be small, so its easy to slip in, but I'm concerned about the decision making slowing us down and distracting us from other work.

@kbknapp
Copy link
Member

kbknapp commented Oct 10, 2021

This one seems much more simple to me to decide on than some of the other defaults questions. I essentially agree with @joshtriplett 100%. If our default features includes color, we color the terminal by default. However, we must maintain a way for users to turn that off both at runtime and by just not compiling the color feature.

@joshtriplett
Copy link
Contributor

I agree; this one seems straightforward compared to other potential changes to defaults.

@epage
Copy link
Member Author

epage commented Oct 11, 2021

If our default features includes color, we color the terminal by default. However, we must maintain a way for users to turn that off both at runtime and by just not compiling the color feature.

We still have the Always, Auto, Never settings.

If there is no real dispute on this (which is never really predictable, see bike shedding), I'll go ahead and remove it.

@epage epage modified the milestones: 4.0, 3.0 Oct 11, 2021
@bors bors bot closed this as completed in 6dd9d46 Oct 11, 2021
epage pushed a commit to epage/clapng that referenced this issue Dec 4, 2021
)

Until we have a modular help generator that can be configured and/or
authored by the users themselves as part of #2914, we will provide the
flexibility of turning off colored help messages but still wanting
colored error messages.

This flexibility was available before #2845 and @dbrgn immediately
noticed it and requested it back to which I agree. This was also
suggested by Josh in
[here](clap-rs/clap#2806 (comment))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Raise on the bar on expectations M-breaking-change Meta: Implementing or merging this will introduce a breaking change.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants