on master help sign in
Added args
commitd702d6740c23ce67a329d9a1e6a971c6023046fe authorNisheet Sinvhal <nisheet1.sinvhal@gmail.com> dateThu 1 Nov 2018, 00:57 (8 years ago) parentc6a526f
2 files changed+15
src/app.rs+6 src/clap_app.rs+9
src/app.rs+6
@@ -76,6 +76,8 @@ pub struct Config<'a> {
7676
7777 /// Command to start the pager
7878 pub pager: Option<&'a str>,
79+
80+ pub italics: bool
7981}
8082
8183fn is_truecolor_terminal() -> bool {
@@ -258,6 +260,10 @@ impl App {
258260 output_components,
259261 syntax_mapping,
260262 pager: self.matches.value_of("pager"),
263+ italics: match self.matches.value_of("enable-italics") {
264+ Some("always") => true,
265+ _ => false
266+ },
261267 })
262268 }
263269
src/clap_app.rs+9
@@ -320,6 +320,15 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
320320 .hidden(true)
321321 .help("Show path to the configuration file."),
322322 )
323+ .arg(
324+ Arg::with_name("enable-italics")
325+ .long("enable-italics")
326+ .takes_value(true)
327+ .possible_values(&["always", "never"])
328+ .default_value("never")
329+ .hide_default_value(true)
330+ .help("Use italics in output (always, *never)")
331+ )
323332 .subcommand(
324333 SubCommand::with_name("cache")
325334 .about("Modify the syntax-definition and theme cache")