pub struct GrabConfig {
pub target_path: PathBuf,
pub add_headers: bool,
pub exclude_patterns: Vec<String>,
pub include_untracked: bool,
pub include_default_output: bool,
pub no_git: bool,
pub include_tree: bool,
pub convert_pdf: bool,
pub all_repo: 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,
or if no_git is true.
include_default_output: boolIf true, the default exclusion for dirgrab.txt will not be applied.
Use this flag only if you specifically need to include a file named dirgrab.txt.
no_git: boolIf true, forces dirgrab to ignore any Git repository context and treat the
target path purely as a filesystem directory. This disables .gitignore
processing and the effect of include_untracked. User-provided exclude
patterns (-e) are still respected.
include_tree: boolIf true, prepend an indented directory tree structure to the output, showing the files and directories included in the grab operation.
convert_pdf: boolIf true, attempt to extract text content from PDF files.
all_repo: boolIf true, operate on the entire Git repository even when the target path is a subdirectory.
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