Struct clap_builder::builder::styling::Styles
source · pub struct Styles { /* private fields */ }
Expand description
Terminal styling definitions
See also Command::styles
.
Example
clap v3 styling
let styles = Styles::styled()
.header(AnsiColor::Yellow.on_default())
.usage(AnsiColor::Green.on_default())
.literal(AnsiColor::Green.on_default())
.placeholder(AnsiColor::Green.on_default());
Implementations§
source§impl Styles
impl Styles
sourcepub const fn header(self, style: Style) -> Self
pub const fn header(self, style: Style) -> Self
General Heading style, e.g. help_heading
sourcepub const fn placeholder(self, style: Style) -> Self
pub const fn placeholder(self, style: Style) -> Self
Descriptions within command-line syntax, e.g. value_name
source§impl Styles
impl Styles
Reflection
sourcepub const fn get_header(&self) -> &Style
pub const fn get_header(&self) -> &Style
General Heading style, e.g. help_heading
sourcepub const fn get_literal(&self) -> &Style
pub const fn get_literal(&self) -> &Style
Literal command-line syntax, e.g. --help
sourcepub const fn get_placeholder(&self) -> &Style
pub const fn get_placeholder(&self) -> &Style
Descriptions within command-line syntax, e.g. value_name
sourcepub const fn get_invalid(&self) -> &Style
pub const fn get_invalid(&self) -> &Style
Highlight invalid usage