summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2023-03-04 00:37:00 +0400
committerJoursoir <chat@joursoir.net>2023-03-04 01:04:07 +0400
commit7ed5366c0bdf376eb910fed9e566a063f2c35806 (patch)
treeb1c692519c36182e8af8c5344ba280e05efbddae
parent78a773e9596e7af2d053b3fb79b38781211b9220 (diff)
downloadtrgrep-7ed5366c0bdf376eb910fed9e566a063f2c35806.tar.gz
trgrep-7ed5366c0bdf376eb910fed9e566a063f2c35806.tar.bz2
trgrep-7ed5366c0bdf376eb910fed9e566a063f2c35806.zip
accept only long option to print a help info
-rw-r--r--src/main.rs5
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,