1
0
Fork 0
No description
Find a file
Andrew Tomaka e63426f7c7 Add directory filtering with --include-dir and --exclude-dir flags
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
2025-06-12 22:12:45 -04:00
archiver Apply standard Go formatting and update project documentation 2025-06-12 22:02:26 -04:00
collector Add directory filtering with --include-dir and --exclude-dir flags 2025-06-12 22:12:45 -04:00
CLAUDE.md Apply standard Go formatting and update project documentation 2025-06-12 22:02:26 -04:00
go.mod Implement collect CLI tool 2025-06-12 21:38:00 -04:00
main.go Add directory filtering with --include-dir and --exclude-dir flags 2025-06-12 22:12:45 -04:00
plan.md Add implementation plan for collect CLI tool 2025-06-12 21:23:56 -04:00
README.md Initial commit 2025-06-12 21:10:27 -04:00
test.sh Add directory filtering with --include-dir and --exclude-dir flags 2025-06-12 22:12:45 -04:00

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