use regex::Regex;
use std::path::PathBuf;
pub mod builder;
mod parsing;
mod path_resolve;
mod validation;
#[derive(Debug)]
pub struct Config {
pub input_path: PathBuf,
pub base_path_display: String,
pub input_is_file: bool,
pub max_size: Option<u128>, pub recursive: bool,
pub extensions: Option<Vec<String>>,
pub exclude_extensions: Option<Vec<String>>,
pub ignore_patterns: Option<Vec<String>>,
pub exclude_path_regex: Option<Vec<Regex>>,
pub path_regex: Option<Vec<Regex>>,
pub filename_regex: Option<Vec<Regex>>,
pub use_gitignore: bool,
pub include_binary: bool,
pub skip_lockfiles: bool,
pub remove_comments: bool,
pub remove_empty_lines: bool,
pub filename_only_header: bool,
pub line_numbers: bool,
pub backticks: bool,
pub output_destination: OutputDestination,
pub summary: bool,
pub counts: bool,
pub process_last: Option<Vec<String>>,
pub only_last: bool,
pub dry_run: bool,
pub git_branch: Option<String>,
pub git_depth: Option<u32>,
}
#[cfg(test)]
impl Config {
pub fn new_for_test() -> Self {
Self {
input_path: PathBuf::from("."),
base_path_display: ".".to_string(),
input_is_file: false,
max_size: None,
recursive: true,
extensions: None,
exclude_extensions: None,
ignore_patterns: None,
path_regex: None,
exclude_path_regex: None,
filename_regex: None,
use_gitignore: true,
include_binary: false,
skip_lockfiles: false,
remove_comments: false,
remove_empty_lines: false,
filename_only_header: false,
line_numbers: false,
backticks: false,
output_destination: OutputDestination::Stdout,
summary: false,
counts: false,
process_last: None,
only_last: false,
dry_run: false,
git_branch: None,
git_depth: None,
}
}
}
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum OutputDestination {
Stdout,
File(PathBuf),
Clipboard,
}