diff --git a/regex-cli/cmd/find/half/mod.rs b/regex-cli/cmd/find/half/mod.rs index a7239f234..4dd33bd3d 100644 --- a/regex-cli/cmd/find/half/mod.rs +++ b/regex-cli/cmd/find/half/mod.rs @@ -2,12 +2,12 @@ use std::io::{stdout, Write}; use { anyhow::Context, - lexopt::{Arg, Parser}, + lexopt::Parser, regex_automata::{HalfMatch, Input, MatchError, PatternID}, }; use crate::{ - args::{self, Configurable, Usage}, + args, util::{self, Table}, }; @@ -49,43 +49,6 @@ ENGINES: } } -#[derive(Debug, Default)] -struct Args { - overlapping: bool, -} - -impl Configurable for Args { - fn configure( - &mut self, - _: &mut Parser, - arg: &mut Arg, - ) -> anyhow::Result { - match *arg { - Arg::Long("overlapping") => { - self.overlapping = true; - } - _ => return Ok(false), - } - Ok(true) - } - - fn usage(&self) -> &[Usage] { - const USAGES: &[Usage] = &[Usage::new( - "--overlapping", - "Search for overlapping matches.", - r#" -This flag enables overlapping mode, where the regex engine will attempt to find -all possible matches reported by the underlying matcher. - -Generally this flag is used in conjunction with '--match-kind all'. If the -match semantics are not set to compile all possible matches in the underlying -automaton, then the results will likely be counter-intuitive. -"#, - )]; - USAGES - } -} - fn run_regex(p: &mut lexopt::Parser) -> anyhow::Result<()> { const USAGE: &'static str = "\ Executes a search for half matches using the top-level API regex engine.