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
|
|
@ -83,7 +83,7 @@ cd ../test
|
|||
|
||||
# Run mail2couch with test configuration
|
||||
print_status "Running mail2couch with test configuration..."
|
||||
../go/mail2couch -config config-test.json -max-messages 3
|
||||
../go/mail2couch --config config-test.json --max-messages 3
|
||||
|
||||
# Verify results
|
||||
print_status "Verifying test results..."
|
||||
|
|
@ -112,7 +112,7 @@ done
|
|||
|
||||
# Test sync mode by running again (should show incremental behavior)
|
||||
print_status "Running mail2couch again to test incremental sync..."
|
||||
../go/mail2couch -config config-test.json -max-messages 3
|
||||
../go/mail2couch --config config-test.json --max-messages 3
|
||||
|
||||
print_status "🎉 Basic integration tests completed successfully!"
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ build_app() {
|
|||
run_first_sync() {
|
||||
echo -e "\n${BLUE}Running first sync...${NC}"
|
||||
cd go
|
||||
./mail2couch -config ../test/config-test.json -max-messages 5
|
||||
./mail2couch --config ../test/config-test.json --max-messages 5
|
||||
cd ..
|
||||
}
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ EOF
|
|||
run_incremental_sync() {
|
||||
echo -e "\n${BLUE}Running incremental sync...${NC}"
|
||||
cd go
|
||||
./mail2couch -config ../test/config-test.json -max-messages 10
|
||||
./mail2couch --config ../test/config-test.json --max-messages 10
|
||||
cd ..
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ run_test() {
|
|||
|
||||
# Run mail2couch and capture output
|
||||
cd go
|
||||
if ./mail2couch -config "../test/$config_file" -max-messages "$max_messages" 2>&1; then
|
||||
if ./mail2couch --config "../test/$config_file" --max-messages "$max_messages" 2>&1; then
|
||||
echo -e "${GREEN}✅ Test completed successfully${NC}"
|
||||
else
|
||||
echo -e "${RED}❌ Test failed${NC}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue