(sys System, locale locale.Locale, optionsList []*tsoptions.CommandLineOption)
| 192 | } |
| 193 | |
| 194 | func generateGroupOptionOutput(sys System, locale locale.Locale, optionsList []*tsoptions.CommandLineOption) []string { |
| 195 | var maxLength int |
| 196 | for _, option := range optionsList { |
| 197 | curLenght := len(getDisplayNameTextOfOption(option)) |
| 198 | maxLength = max(curLenght, maxLength) |
| 199 | } |
| 200 | |
| 201 | // left part should be right align, right part should be left align |
| 202 | |
| 203 | // assume 2 space between left margin and left part. |
| 204 | rightAlignOfLeftPart := maxLength + 2 |
| 205 | // assume 2 space between left and right part |
| 206 | leftAlignOfRightPart := rightAlignOfLeftPart + 2 |
| 207 | |
| 208 | var lines []string |
| 209 | for _, option := range optionsList { |
| 210 | tmp := generateOptionOutput(sys, locale, option, rightAlignOfLeftPart, leftAlignOfRightPart) |
| 211 | lines = append(lines, tmp...) |
| 212 | } |
| 213 | |
| 214 | // make sure always a blank line in the end. |
| 215 | if len(lines) < 2 || lines[len(lines)-2] != "\n" { |
| 216 | lines = append(lines, "\n") |
| 217 | } |
| 218 | |
| 219 | return lines |
| 220 | } |
| 221 | |
| 222 | func generateOptionOutput( |
| 223 | sys System, |
no test coverage detected