forked from rust-lang/regex
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmod.rs
28 lines (24 loc) · 862 Bytes
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
mod compile_test;
mod debug;
mod find;
mod generate;
const USAGE: &'static str = "\
A tool for interacting with Rust's regex crate on the command line.
USAGE:
regex-cli <command> ...
COMMANDS:
compile-test Measure binary size and compile time of various configs.
debug Print the debug representation of things from regex-automata.
find Search haystacks with one of many different regex engines.
generate Various generation tasks, e.g., serializing DFAs.
";
pub fn run(p: &mut lexopt::Parser) -> anyhow::Result<()> {
let cmd = crate::args::next_as_command(USAGE, p)?;
match &*cmd {
"compile-test" => compile_test::run(p),
"find" => find::run(p),
"debug" => debug::run(p),
"generate" => generate::run(p),
unk => anyhow::bail!("unrecognized command '{}'", unk),
}
}