feat(output): improve readability with better formatting#6
Merged
Conversation
| } | ||
| channelParts = append(channelParts, "CS") | ||
| } | ||
|
|
There was a problem hiding this comment.
🚫 [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
| @@ -93,7 +107,28 @@ var listCmd = &cobra.Command{ | |||
| case "json": | |||
There was a problem hiding this comment.
🚫 [golangci] reported by reviewdog 🐶
string json has 3 occurrences, make it a constant (goconst)
| @@ -84,7 +98,28 @@ var listCmd = &cobra.Command{ | |||
| case "json": | |||
There was a problem hiding this comment.
🚫 [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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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