-
Notifications
You must be signed in to change notification settings - Fork 0
feat(output): improve readability with better formatting #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| } | ||
| channelParts = append(channelParts, "CS") | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
File is not properly formatted (gofmt)
Major improvements to make CLI output more human-readable:
- **Timestamps**: Format Unix milliseconds as "MM/DD HH:MM" instead of raw numbers
- **Boolean values**: Use symbols (✓/-/✗) instead of "true"/"false" for better scanning
- **Large IDs**: Shorten long ID numbers (e.g., "...23608" instead of "3239123608")
- **Status indicators**: Use symbols (✓/✗/⏰) for rule status instead of text
- **Channel types**: Use descriptive labels ("地上波" instead of "GR")
- **Description truncation**: Limit long text fields to prevent table overflow
These changes apply to all commands and significantly improve terminal readability
while maintaining full functionality. Output now fits better in terminal windows
and is much easier to scan quickly.
Enhanced reserves and encodes commands with comprehensive improvements: **Custom Column Display:** - Default: Essential columns only for better terminal fit - Verbose (`--verbose`): Additional detail columns - Full (`--full`): All available columns - Custom (`--columns`): User-specified column selection **Readability Improvements:** - Timestamps: Format Unix milliseconds as "MM/DD HH:MM" - Boolean values: Use symbols (✓/-/✗) instead of "true"/"false" - Large IDs: Shorten long numbers for better scanning - Description truncation: Prevent table overflow **Reserves Command:** - Default columns: Id, Name, StartAt, EndAt, ChannelId, IsConflict, IsSkip, IsOverlap - Verbose adds: RuleId, ProgramId, Description - Reduced default limit from 24 to 10 items **Encodes Command:** - Default columns: ID, Mode, Status, Percent, Name - Verbose adds: Log - Smart status display for running/waiting jobs These changes significantly improve CLI usability while maintaining full functionality.
bf6a512 to
f406421
Compare
|
|
||
| var formatter output.Formatter | ||
| switch cfg.Output.Format { | ||
| case "json": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
string json has 3 occurrences, make it a constant (goconst)
|
|
||
| var formatter output.Formatter | ||
| switch cfg.Output.Format { | ||
| case "json": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
string json has 4 occurrences, make it a constant (goconst)
- Exclude binaries, build artifacts, and test outputs - Ignore IDE files and OS-generated files - Exclude environment variables and logs - Add project-specific binary name (epgstationctl) - Include common Node.js artifacts for any frontend components - Exclude coverage reports and profiling data
Summary
Comprehensive improvements to CLI output readability across all commands:
Key Changes
Enhanced Output Formatter (
internal/output/formatter.go)formatValueWithContext()for field-aware formattingintandint64Unix millisecondsImproved Rules Display (
internal/commands/rules/rules.go)Impact
These changes significantly improve the user experience by:
Test Plan
Compatibility