@@ -2,12 +2,12 @@ use std::io::{stdout, Write};
22
33use {
44 anyhow:: Context ,
5- lexopt:: { Arg , Parser } ,
5+ lexopt:: Parser ,
66 regex_automata:: { HalfMatch , Input , MatchError , PatternID } ,
77} ;
88
99use crate :: {
10- args:: { self , Configurable , Usage } ,
10+ args,
1111 util:: { self , Table } ,
1212} ;
1313
@@ -49,43 +49,6 @@ ENGINES:
4949 }
5050}
5151
52- #[ derive( Debug , Default ) ]
53- struct Args {
54- overlapping : bool ,
55- }
56-
57- impl Configurable for Args {
58- fn configure (
59- & mut self ,
60- _: & mut Parser ,
61- arg : & mut Arg ,
62- ) -> anyhow:: Result < bool > {
63- match * arg {
64- Arg :: Long ( "overlapping" ) => {
65- self . overlapping = true ;
66- }
67- _ => return Ok ( false ) ,
68- }
69- Ok ( true )
70- }
71-
72- fn usage ( & self ) -> & [ Usage ] {
73- const USAGES : & [ Usage ] = & [ Usage :: new (
74- "--overlapping" ,
75- "Search for overlapping matches." ,
76- r#"
77- This flag enables overlapping mode, where the regex engine will attempt to find
78- all possible matches reported by the underlying matcher.
79-
80- Generally this flag is used in conjunction with '--match-kind all'. If the
81- match semantics are not set to compile all possible matches in the underlying
82- automaton, then the results will likely be counter-intuitive.
83- "# ,
84- ) ] ;
85- USAGES
86- }
87- }
88-
8952fn run_regex ( p : & mut lexopt:: Parser ) -> anyhow:: Result < ( ) > {
9053 const USAGE : & ' static str = "\
9154 Executes a search for half matches using the top-level API regex engine.
0 commit comments