/*!
Provides the definition of high level arguments from CLI flags.
*/
use std::{
collections::HashSet,
path::{Path, PathBuf},
};
use {
bstr::BString,
grep::printer::{ColorSpecs, SummaryKind},
};
use crate::{
flags::lowargs::{
BinaryMode, BoundaryMode, BufferMode, CaseMode, ColorChoice,
ContextMode, ContextSeparator, EncodingMode, EngineChoice,
FieldContextSeparator, FieldMatchSeparator, LowArgs, MmapMode, Mode,
PatternSource, SearchMode, SortMode, SortModeKind, TypeChange,
},
haystack::{Haystack, HaystackBuilder},
search::{PatternMatcher, Printer, SearchWorker, SearchWorkerBuilder},
};
/// A high level representation of CLI arguments.
///
/// The distinction between low and high level arguments is somewhat arbitrary
/// and wishy washy. The main idea here is that high level arguments generally
/// require all of CLI parsing to be finished. For example, one cannot
/// construct a glob matcher until all of the glob patterns are known.
///
/// So while low level arguments are collected during parsing itself, high
/// level arguments aren't created until parsing has completely finished.
#[derive(Debug)]
pub(crate) struct HiArgs {
binary: BinaryDetection,
boundary: Option<BoundaryMode>,
buffer: BufferMode,
byte_offset: bool,
case: CaseMode,
color: ColorChoice,
colors: grep::printer::ColorSpecs,
column: bool,
context: ContextMode