1use clap::Parser;
2
3#[derive(Parser, Debug)]
4#[command(
5 name = "rgx",
6 version,
7 about = "Terminal regex tester with real-time matching and multi-engine support",
8 long_about = "Test and debug regular expressions without leaving your terminal. Supports 3 engines (Rust regex, fancy-regex, PCRE2), capture group highlighting, plain-English explanations, and replace mode. Useful for remote work, shell pipelines, and engine-specific testing."
9)]
10pub struct Cli {
11 #[arg(value_name = "PATTERN")]
13 pub pattern: Option<String>,
14
15 #[arg(short, long)]
17 pub engine: Option<String>,
18
19 #[arg(short = 'i', long)]
21 pub case_insensitive: bool,
22
23 #[arg(short = 'm', long)]
25 pub multiline: bool,
26
27 #[arg(short = 's', long)]
29 pub dotall: bool,
30
31 #[arg(short = 'u', long)]
33 pub unicode: Option<bool>,
34
35 #[arg(short = 'x', long)]
37 pub extended: bool,
38
39 #[arg(short = 'r', long)]
41 pub replacement: Option<String>,
42
43 #[arg(short = 'f', long)]
45 pub file: Option<String>,
46
47 #[arg(short = 't', long)]
49 pub text: Option<String>,
50
51 #[arg(short = 'l', long)]
53 pub load: Option<String>,
54
55 #[arg(short = 'p', long)]
58 pub print: bool,
59
60 #[arg(short = 'P', long, conflicts_with = "print")]
63 pub output_pattern: bool,
64
65 #[arg(short = 'g', long, requires = "print", conflicts_with = "count")]
68 pub group: Option<String>,
69
70 #[arg(short = 'c', long, requires = "print", conflicts_with = "group")]
72 pub count: bool,
73
74 #[arg(long)]
76 pub rounded: bool,
77
78 #[arg(long)]
80 pub vim: bool,
81}