Skip to content

Commit 656077a

Browse files
committed
Crop state field if necessary
Limit the state field of jobs to 12 characters.
1 parent d437519 commit 656077a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cmd/openqa-revtui/openqa-revtui.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ func parseProgramArgs() error {
350350
}
351351

352352
func printUsage() {
353-
// TODO: Write this
354353
fmt.Printf("Usage: %s [OPTIONS] [FLAVORS]\n", os.Args[0])
355354
fmt.Println("")
356355
fmt.Println("OPTIONS")

cmd/openqa-revtui/tui.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,13 @@ func (tui *TUI) formatJobLine(job gopenqa.Job, width int) string {
577577
}
578578
}
579579

580+
// Crop the state field, if necessary
581+
if state == "timeout_exceeded" {
582+
state = "timeout"
583+
} else if len(state) > 12 {
584+
state = state[0:12]
585+
}
586+
580587
// Full status line requires 89 characters (20+4+8+1+12+1+40+3) plus name
581588
if width > 90 {
582589
// Crop the name, if necessary

0 commit comments

Comments
 (0)