(sys System, message string)
| 42 | } |
| 43 | |
| 44 | func getHeader(sys System, message string) []string { |
| 45 | colors := createColors(sys) |
| 46 | header := make([]string, 0, 3) |
| 47 | terminalWidth := sys.GetWidthOfTerminal() |
| 48 | const tsIcon = " " |
| 49 | const tsIconTS = " TS " |
| 50 | const tsIconLength = len(tsIcon) |
| 51 | |
| 52 | tsIconFirstLine := colors.blueBackground(tsIcon) |
| 53 | tsIconSecondLine := colors.blueBackground(colors.brightWhite(tsIconTS)) |
| 54 | // If we have enough space, print TS icon. |
| 55 | if terminalWidth >= len(message)+tsIconLength { |
| 56 | // right align of the icon is 120 at most. |
| 57 | rightAlign := core.IfElse(terminalWidth > 120, 120, terminalWidth) |
| 58 | leftAlign := rightAlign - tsIconLength |
| 59 | header = append(header, fmt.Sprintf("%-*s", leftAlign, message), tsIconFirstLine, "\n") |
| 60 | header = append(header, strings.Repeat(" ", leftAlign), tsIconSecondLine, "\n") |
| 61 | } else { |
| 62 | header = append(header, message, "\n", "\n") |
| 63 | } |
| 64 | return header |
| 65 | } |
| 66 | |
| 67 | func printEasyHelp(sys System, locale locale.Locale, simpleOptions []*tsoptions.CommandLineOption) { |
| 68 | colors := createColors(sys) |
no test coverage detected