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

refactor(styles): make styles example use a const #5636

Merged
merged 1 commit into from
Aug 8, 2024

Commits on Aug 8, 2024

  1. refactor(styles): make styles example use a const

    This makes it easier to copy this example for use in the derive API,
    like so:
    
    ```rust
    const STYLES: Styles = Styles::styled()
        .header(AnsiColor::Green.on_default().bold())
        .usage(AnsiColor::Green.on_default().bold())
        .literal(AnsiColor::Blue.on_default().bold())
        .placeholder(AnsiColor::Cyan.on_default());
    
    #[derive(Parser)]
    #[clap(styles = STYLES)]
    struct Cmd {
      ...
    }
    ```
    
    If you use the `|` method then it's not a constant function.
    gibfahn committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    6f215ee View commit details
    Browse the repository at this point in the history