diff options
author | Joursoir <chat@joursoir.net> | 2023-03-04 00:37:00 +0400 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2023-03-04 01:04:07 +0400 |
commit | 7ed5366c0bdf376eb910fed9e566a063f2c35806 (patch) | |
tree | b1c692519c36182e8af8c5344ba280e05efbddae | |
parent | 78a773e9596e7af2d053b3fb79b38781211b9220 (diff) | |
download | trgrep-7ed5366c0bdf376eb910fed9e566a063f2c35806.tar.gz trgrep-7ed5366c0bdf376eb910fed9e566a063f2c35806.tar.bz2 trgrep-7ed5366c0bdf376eb910fed9e566a063f2c35806.zip |
accept only long option to print a help info
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index d7d15a5..72efe60 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,6 +7,7 @@ use clap::Parser; #[derive(Parser)] #[command(author, version, about, long_about = None)] // Read from `Cargo.toml` +#[clap(disable_help_flag = true)] struct Config { /// The pattern to look for pattern: String, @@ -15,6 +16,10 @@ struct Config { /// If no FILE is given, read standard input. files: Vec<String>, + /// Print a help text and exit + #[arg(long, action = clap::ArgAction::Help)] + help: Option<bool>, + /// Ignores the case of the search string #[arg(short, long)] ignore_case: bool, |