feat: implement GNU-style command line options with pflag
- Add pflag dependency for POSIX/GNU-style command line parsing - Replace Go standard flag package with pflag for better UX - Implement long options with double dashes (--config, --max-messages, --help) - Add short option aliases with single dashes (-c, -m, -h) - Update help message with proper formatting and application description - Update all documentation to reflect new flag syntax - Update test scripts to use new command line format GNU-style options provide better usability: - Long descriptive options with --flag-name format - Short single-character aliases for common options - Standard help flag behavior with --help/-h - Compatible with shell completion and standard conventions Command line interface now supports: - --config/-c FILE: Path to configuration file - --max-messages/-m N: Message processing limit per mailbox - --help/-h: Show help message and exit All existing functionality preserved with improved command line experience. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
651d95e98b
commit
031dd86b0d
8 changed files with 47 additions and 28 deletions
10
CLAUDE.md
10
CLAUDE.md
|
|
@ -20,13 +20,13 @@ cd go && go build -o mail2couch .
|
|||
cd go && ./mail2couch
|
||||
|
||||
# Run with specific config file
|
||||
cd go && ./mail2couch -config /path/to/config.json
|
||||
cd go && ./mail2couch --config /path/to/config.json
|
||||
|
||||
# Run with message limit (useful for large mailboxes)
|
||||
cd go && ./mail2couch -max-messages 100
|
||||
cd go && ./mail2couch --max-messages 100
|
||||
|
||||
# Run with both config and message limit
|
||||
cd go && ./mail2couch -config /path/to/config.json -max-messages 50
|
||||
cd go && ./mail2couch --config /path/to/config.json --max-messages 50
|
||||
|
||||
# Run linting/static analysis
|
||||
cd go && go vet ./...
|
||||
|
|
@ -80,7 +80,7 @@ The application uses `config.json` for configuration with the following structur
|
|||
### Configuration File Discovery
|
||||
|
||||
The application automatically searches for configuration files in the following order:
|
||||
1. Path specified by `-config` command line flag
|
||||
1. Path specified by `--config`/`-c` command line flag
|
||||
2. `./config.json` (current working directory)
|
||||
3. `./config/config.json` (config subdirectory)
|
||||
4. `~/.config/mail2couch/config.json` (user XDG config directory)
|
||||
|
|
@ -104,7 +104,7 @@ This design ensures the same `config.json` format will work for both Go and Rust
|
|||
- ✅ Sync vs Archive mode implementation
|
||||
- ✅ CouchDB attachment storage for email attachments
|
||||
- ✅ Full message body and attachment handling with MIME multipart support
|
||||
- ✅ Command line argument support (--max-messages flag)
|
||||
- ✅ Command line argument support (GNU-style --max-messages/-m and --config/-c flags)
|
||||
- ✅ Per-account CouchDB databases for better organization
|
||||
- ✅ Incremental sync functionality with IMAP SEARCH and sync metadata tracking
|
||||
- ❌ Rust implementation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue