Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors CLI flag names and parsing, adds a verbose mode to the version command, and updates help/docs and tests to reflect the new conventions.
- Introduces clear flag categories with new --use-* and --output-* prefixes, and marks older flags as deprecated while keeping them supported.
- Adds -v/--verbose to the version command and refactors flag parsing into grouped helpers for generate, check, and documentation.
- Updates help text, docs, and testdata to (mostly) align with the new flags and adds backward-compatibility tests.
Reviewed Changes
Copilot reviewed 72 out of 72 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/cli/help.txt | Replaces ad-hoc help with structured usage, commands, and categorized flags; adds verbose flag note. |
| internal/cli/commands.go | Adds grouped flag sets, new/deprecated flag names, new check/documentation configs, and verbose-enabled version command. |
| internal/cli/commands_test.go | Updates tests to new flag names and adds backward-compatibility tests for deprecated flags. |
| docs/* | Broad doc updates for flag naming; some instances now use deprecated names that should be updated. |
| cmd/muxt/testdata/* | Updates end-to-end test scripts to new flags; adds comprehensive and deprecated-flag coverage. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
beb05f3 to
48a1338
Compare
- Update versionCommand signature to accept stderr parameter - Set flag parsing output to stderr instead of stdout - Follows CLI best practice: errors to stderr, output to stdout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replace all --find-* flags with --use-* throughout documentation - Replace --logger with --output-routes-func-with-logger-param as primary flag - Replace --path-prefix with --output-routes-func-with-path-prefix-param - Mark old --logger and --path-prefix as deprecated in feature flags table - Document version command's new -v, --verbose flag for showing Go version - Update all code examples to use current flag names - Update quick reference table to reflect current common flags 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- getting-started.md: Update to use --use-receiver-type - templates-variable.md: Replace --find-templates-variable with --use-templates-variable - call-parameters.md: Replace --find-receiver-type with --use-receiver-type - add-logging.md: Update to use --use-receiver-type and --output-routes-func-with-logger-param - Add note that --logger is deprecated - Update all command examples All documentation now uses current, non-deprecated flag names. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # docs/reference/cli.md
- Refactor flag registration to reduce duplication - Extract flag groups into helper functions (addUseFlagsToFlagSet, addOutputFlagsToFlagSet, etc.) - Each helper registers flags and handles deprecation marking in one place - Reduces ~120 lines of duplicated code across command-specific flag sets - Split flags by command for better organization - All commands support -v/--verbose flag - generate: --use-* and --output-* flags - check and documentation: --use-* flags only - Add Go version output to version command - Running `muxt version -v` now displays the Go version used to compile muxt - Maintains backward compatibility: `muxt version` shows only muxt version - Update help text to clearly document which flags work with which commands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add explicit flag tables for check and documentation commands - Previously said 'same as generate' which was misleading - These commands only support --use-* flags, not --output-* flags - Add comprehensive deprecated flags reference table - Shows all old flag names and their new equivalents - Helps users migrate from deprecated flags - Clarify that check and docs commands support --use-* flags only 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
a4adb62 to
b5b8d5a
Compare
Code Review: PR #43 - Improve command flag names and parsingSummaryThis PR represents a significant improvement to the CLI interface with a thoughtful flag reorganization that enhances usability and maintainability. The changes are well-executed with strong backward compatibility and comprehensive test coverage. ✅ Strengths1. Excellent Flag OrganizationThe new
Example transformation: # Before (unclear)
--receiver-type=Server --logger --path-prefix
# After (clear intent)
--use-receiver-type=Server --output-routes-func-with-logger-param --output-routes-func-with-path-prefix-param2. Strong Backward Compatibility
3. Code Quality & RefactoringThe refactoring in
4. Test CoverageOutstanding test additions:
5. Documentation Quality
6. Version Command EnhancementAdding $ muxt version -v
v0.1.0
go version: go1.24🔍 Code AnalysisArchitecture
Error Handling
💡 Minor Suggestions1. Consider Constants for Long Flag NamesThe long flag names like // Current (very explicit)
--output-routes-func-with-logger-param
// Alternative (still clear, slightly shorter)
--output-routes-with-loggerThis is purely a suggestion - the current names are defensible for their explicitness. 2. Help Text ConsistencyIn --output-routes-func-with-logger-param Add *slog.Logger parameter
--output-routes-func-with-path-prefix-param Add pathPrefix string parameterCould be more parallel: --output-routes-func-with-logger-param Add *slog.Logger parameter to routes function
--output-routes-func-with-path-prefix-param Add pathPrefix parameter to routes function3. Test File NamingThe new test files have excellent descriptive names. Consider adding test case numbers or prefixes for easier sorting: Could be: This is optional - current naming is fine. 🔒 Security Review✅ No security concerns identified
⚡ Performance Considerations✅ No performance impact
🐛 Potential IssuesNone FoundI did not identify any bugs. The implementation is solid. 📊 Test Coverage AssessmentExcellent coverage:
Breaking ChangesThis PR is marked as
This is the correct approach for evolving a CLI. Recommendations
ConclusionThis PR demonstrates excellent software engineering practices:
The refactoring reduces duplication, improves UX, and maintains stability. Well done! 🎉 Verdict: LGTM ✅ |
Pull Request Review: Improve Command Flag Names and ParsingOverviewThis PR introduces a comprehensive refactoring of the CLI flag naming scheme, transitioning from ✅ Code Quality & Best PracticesStrengths:
Suggestions:
🐛 Potential Bugs & IssuesMinor Issues:
⚡ Performance ConsiderationsAssessment: No performance concerns identified.
🔒 Security ConcernsAssessment: No security issues identified.
🧪 Test CoverageStrengths:
Gaps:
📋 Additional ObservationsDocumentation Updates:
Breaking Change Communication:
🎯 RecommendationsHigh Priority:
Medium Priority: Low Priority: ✨ SummaryThis is a high-quality refactoring that significantly improves the CLI's usability and maintainability. The code follows Go best practices, maintains excellent backward compatibility, and includes comprehensive test coverage. The semantic distinction between The minor issues identified are primarily about test coverage completeness and minor validation gaps - the core implementation is solid and production-ready. Recommendation: ✅ Approve with minor suggestions Great work on maintaining backward compatibility while improving the interface! 🎉 |
also add verbose mode for
muxt version