Browse Source

doc: improve help for timehist regex argument

pull/2/head
JuanLeon Lahoz 5 years ago
parent
commit
4347611b48
  1. 2
      Cargo.lock
  2. 2
      Cargo.toml
  3. 12
      src/app.rs

2
Cargo.lock generated

@ -306,7 +306,7 @@ dependencies = [
[[package]]
name = "lowcharts"
version = "0.2.0"
version = "0.3.2"
dependencies = [
"assert_cmd",
"chrono",

2
Cargo.toml

@ -1,6 +1,6 @@
[package]
name = "lowcharts"
version = "0.3.1"
version = "0.3.2"
authors = ["JuanLeon Lahoz <juanleon.lahoz@gmail.com>"]
edition = "2018"
description = "Tool to draw low-resolution graphs in terminal"

12
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!())

Loading…
Cancel
Save