No description
Implement comprehensive directory filtering functionality that allows users to control which directories are traversed during file collection. Features: - --include-dir: Only traverse directories matching specified patterns - --exclude-dir: Skip directories matching specified patterns - Support for glob patterns (e.g., 'temp-*', 'project-*') - Multiple filters with OR logic (like existing --name/--match flags) - Include filters take precedence over exclude filters when both specified - Seamless integration with existing file matching functionality Implementation: - Add DirectoryFilter interface with Include/Exclude/Composite implementations - Update Collector to accept optional DirectoryFilter and use filepath.SkipDir - Add CLI flags and argument parsing for new directory filtering options - Comprehensive test suite with 7 new test cases covering all scenarios |
||
---|---|---|
archiver | ||
collector | ||
CLAUDE.md | ||
go.mod | ||
main.go | ||
plan.md | ||
README.md | ||
test.sh |
collect
CLI tool that collects files recursively matching specific names, maintains their file structure, and adds them to an archive for backup.
Examples
Finds all files named .mise.toml
collect --name .mise.toml ./ backup.tgz
Finds all files nested in a directory that glob matches aet-* (ie. aet-bin)
collect --match aet-*/ ./ backup.zip