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

System property to let end users set color scheme #84

Closed
remkop opened this issue Apr 10, 2017 · 1 comment
Closed

System property to let end users set color scheme #84

remkop opened this issue Apr 10, 2017 · 1 comment

Comments

@remkop
Copy link
Owner

remkop commented Apr 10, 2017

TODO:

  • test
  • update manual
@remkop remkop added this to the 0.4.0 user manual milestone Apr 10, 2017
remkop added a commit that referenced this issue Apr 11, 2017
@remkop
Copy link
Owner Author

remkop commented Apr 12, 2017

The below code snippet shows how a color scheme can be used to configure the usage help message style:

// see also CommandLine.Help.defaultColorScheme()
ColorScheme colorScheme = new ColorScheme()
        .commands    (Style.bold, Style.underline)    // combine multiple styles
        .options     (Style.fg_yellow)                // yellow foreground color
        .parameters  (Style.fg_yellow)
        .optionParams(Style.italic);

CommandLine.usage(annotatedObject, System.out, colorScheme);
...

==== End User Overrides

The following system properties override the color scheme styles. This allows end users to adjust for their individual terminal color setup.

.System Properties to Override the Color Scheme

picocli.color.commands
picocli.color.options
picocli.color.parameters
picocli.color.optionParams

For example:

java -Dpicocli.color.options=blink,blue -Dpicocli.color.parameters=reverse -cp app.jar com.app.Main

System property values may specify multiple comma separated styles.

@remkop remkop closed this as completed in ddec105 Apr 12, 2017
remkop added a commit that referenced this issue Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant