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

feat(help): Add styling to help output #12578

Merged
merged 2 commits into from Sep 11, 2023
Merged

feat(help): Add styling to help output #12578

merged 2 commits into from Sep 11, 2023

Commits on Sep 1, 2023

  1. Copy the full SHA
    e46379a View commit details
    Browse the repository at this point in the history
  2. feat(help): Add styling to help output

    Traditionally, cargo has disabled clap's styled help output.  My assumed
    reason is that cargo mixes custom help output with auto-generated and
    you couldn't previously make it all styled to match.  Clap 4.2 allowed
    users to pass in strings styled using ANSI escape codes, allowing us to
    pass in styled text that matches clap, unblocking this.  In clap
    4.4.1, clap gained the ability for the user to override the style,
    allowing us to choose the styling as we wish.
    
    In this PR, I decided to use the new 4.4.1 feature to style clap's
    output to match the rest of cargo's output.  Alternatively, we could use
    a more subdue style that clap uses by default.  That subdued style was
    mostly chosen to be app theme neurtral (since we didn't have theming
    support yet) and there were problems with our style and no one stepped
    up to fix them (cargo has a style we can match to instead).
    
    I decided to *not* style `Arg::help` messages because
    - It might be distracting to have the descriptions lit up like a
      christmas tree
    - It is a lot more work
    
    The one exception I made was for `--list` since it is for a
    psuedo-command (`...`) and I wanted to intentionally draw attention to
    it.
    epage committed Sep 1, 2023
    Copy the full SHA
    dbbc5dd View commit details
    Browse the repository at this point in the history