Apply standard Go formatting and update project documentation
- Run go fmt on all Go files to ensure consistent formatting - Add official Go tooling commands to CLAUDE.md for code quality - Update project status to reflect current implementation state
This commit is contained in:
parent
1265f9fb07
commit
bde7aeed90
7 changed files with 104 additions and 72 deletions
32
CLAUDE.md
Normal file
32
CLAUDE.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Project Overview
|
||||
|
||||
This is a CLI tool called "collect" that recursively collects files matching specific criteria, maintains their file structure, and archives them for backup purposes.
|
||||
|
||||
## Project Status
|
||||
|
||||
The collect CLI tool has been implemented with the following features:
|
||||
- Multiple `--name` flags for exact filename matching
|
||||
- Multiple `--match` flags for directory pattern matching
|
||||
- Support for combining `--name` and `--match` flags with OR logic
|
||||
- Preserving original directory structure in the output
|
||||
- Creating archives in tar.gz or zip format
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
The tool accepts:
|
||||
1. Multiple `--name` and `--match` flags in any combination
|
||||
2. Two positional arguments: source directory and output archive path
|
||||
3. Archive format determined by output file extension (.tgz/.tar.gz or .zip)
|
||||
4. Recursive directory traversal while preserving original structure
|
||||
|
||||
## Code Quality
|
||||
|
||||
Before committing changes, run these official Go tools:
|
||||
- `go fmt ./...` - Format all Go files to standard style
|
||||
- `go vet ./...` - Check for common mistakes and suspicious code
|
||||
- `go test ./...` - Run unit tests (when available)
|
||||
- `./test.sh` - Run integration tests
|
6
main.go
6
main.go
|
@ -12,10 +12,10 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
exitSuccess = 0
|
||||
exitNoFiles = 1
|
||||
exitSuccess = 0
|
||||
exitNoFiles = 1
|
||||
exitArchiveError = 2
|
||||
exitInvalidArgs = 3
|
||||
exitInvalidArgs = 3
|
||||
)
|
||||
|
||||
// stringSlice is a custom flag type that accumulates string values
|
||||
|
|
Loading…
Add table
Reference in a new issue