mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-21 20:38:44 +00:00
Added args
This commit is contained in:
parent
c6a526f99c
commit
d702d6740c
@ -76,6 +76,8 @@ pub struct Config<'a> {
|
|||||||
|
|
||||||
/// Command to start the pager
|
/// Command to start the pager
|
||||||
pub pager: Option<&'a str>,
|
pub pager: Option<&'a str>,
|
||||||
|
|
||||||
|
pub italics: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_truecolor_terminal() -> bool {
|
fn is_truecolor_terminal() -> bool {
|
||||||
@ -258,6 +260,10 @@ impl App {
|
|||||||
output_components,
|
output_components,
|
||||||
syntax_mapping,
|
syntax_mapping,
|
||||||
pager: self.matches.value_of("pager"),
|
pager: self.matches.value_of("pager"),
|
||||||
|
italics: match self.matches.value_of("enable-italics") {
|
||||||
|
Some("always") => true,
|
||||||
|
_ => false
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,6 +320,15 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|||||||
.hidden(true)
|
.hidden(true)
|
||||||
.help("Show path to the configuration file."),
|
.help("Show path to the configuration file."),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("enable-italics")
|
||||||
|
.long("enable-italics")
|
||||||
|
.takes_value(true)
|
||||||
|
.possible_values(&["always", "never"])
|
||||||
|
.default_value("never")
|
||||||
|
.hide_default_value(true)
|
||||||
|
.help("Use italics in output (always, *never)")
|
||||||
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("cache")
|
SubCommand::with_name("cache")
|
||||||
.about("Modify the syntax-definition and theme cache")
|
.about("Modify the syntax-definition and theme cache")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user