From d702d6740c23ce67a329d9a1e6a971c6023046fe Mon Sep 17 00:00:00 2001 From: Nisheet Sinvhal Date: Thu, 1 Nov 2018 00:57:31 +0530 Subject: [PATCH] Added args --- src/app.rs | 6 ++++++ src/clap_app.rs | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/src/app.rs b/src/app.rs index 0a69195c..7c3e0c3c 100644 --- a/src/app.rs +++ b/src/app.rs @@ -76,6 +76,8 @@ pub struct Config<'a> { /// Command to start the pager pub pager: Option<&'a str>, + + pub italics: bool } fn is_truecolor_terminal() -> bool { @@ -258,6 +260,10 @@ impl App { output_components, syntax_mapping, pager: self.matches.value_of("pager"), + italics: match self.matches.value_of("enable-italics") { + Some("always") => true, + _ => false + }, }) } diff --git a/src/clap_app.rs b/src/clap_app.rs index fff618e1..e7cd6504 100644 --- a/src/clap_app.rs +++ b/src/clap_app.rs @@ -320,6 +320,15 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { .hidden(true) .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::with_name("cache") .about("Modify the syntax-definition and theme cache")