From 4347611b4894250c62bf54b3e64df5481150523c Mon Sep 17 00:00:00 2001 From: JuanLeon Lahoz Date: Tue, 11 May 2021 17:45:50 +0200 Subject: [PATCH] doc: improve help for timehist regex argument --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/app.rs | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2809f48..f394cbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -306,7 +306,7 @@ dependencies = [ [[package]] name = "lowcharts" -version = "0.2.0" +version = "0.3.2" dependencies = [ "assert_cmd", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 87bec4a..6aa009e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lowcharts" -version = "0.3.1" +version = "0.3.2" authors = ["JuanLeon Lahoz "] edition = "2018" description = "Tool to draw low-resolution graphs in terminal" diff --git a/src/app.rs b/src/app.rs index 2fc6efc..8b4b181 100644 --- a/src/app.rs +++ b/src/app.rs @@ -51,6 +51,16 @@ the named one will be used). ) } +fn add_non_capturing_regex(app: App) -> App { + app.arg( + Arg::new("regex") + .long("regex") + .short('R') + .about("Filter out lines where regex is notr present") + .takes_value(true), + ) +} + fn add_width(app: App) -> App { app.arg( Arg::new("width") @@ -118,7 +128,7 @@ pub fn get_app() -> App<'static> { .about("Use this string formatting") .takes_value(true), ); - timehist = add_input(add_width(add_regex(add_intervals(timehist)))); + timehist = add_input(add_width(add_non_capturing_regex(add_intervals(timehist)))); App::new("lowcharts") .author(clap::crate_authors!())