pub struct GrabConfig {
pub target_path: PathBuf,
pub add_headers: bool,
pub exclude_patterns: Vec<String>,
pub include_untracked: bool,
}Expand description
Configuration for the dirgrab operation.
This struct holds all the settings needed to control how dirgrab
finds and processes files within the specified target directory.
It is typically constructed by the calling application (e.g., the CLI)
based on user input.
Fields§
§target_path: PathBufThe starting path for the operation (directory or Git repository).
dirgrab will operate within this path. It will be canonicalized internally.
add_headers: boolIf true, adds '--- FILE: <filename> ---' headers before each file’s content
in the final output string. The filename displayed will be relative to the
Git repository root (if applicable) or the target path.
exclude_patterns: Vec<String>A list of glob patterns (using .gitignore syntax) to exclude files or directories.
These patterns are applied in addition to any .gitignore rules if operating
in Git mode.
In Git mode, they are passed to git ls-files as :!<pattern> pathspecs.
In non-Git mode, they are used to filter the results from walking the directory.
include_untracked: boolIf operating in Git mode, set this to true to include untracked files
(files present in the working directory but not added to the index).
This still respects .gitignore and the exclude_patterns.
This setting has no effect if the target_path is not part of a Git repository.
Trait Implementations§
Source§impl Clone for GrabConfig
impl Clone for GrabConfig
Source§fn clone(&self) -> GrabConfig
fn clone(&self) -> GrabConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more