Skip to content

Commit

Permalink
refactor: sort options before format
Browse files Browse the repository at this point in the history
  • Loading branch information
hui.wang committed Jan 27, 2022
1 parent f3d8d9e commit 2861144
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xcmd/explain.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ func (c *Command) updateUsage(x *xconf.XConf) {
var allLine []string
seperateLineTag := "__GLOBAL_LOCAL_SEPETATELINE"
allLine = append(allLine, headerLine)
sort.Strings(linesGlobal)
allLine = append(allLine, linesGlobal...)
allLine = append(allLine, fmt.Sprintf(seperateLineTag+strings.Repeat(magic, magicCount)))
sort.Strings(linesLocal)
allLine = append(allLine, linesLocal...)
lineAllFormatted := xutil.TableFormatLines(allLine, magic)
lineMaxLen := xutil.StringMaxLenByRune(lineAllFormatted)
Expand Down

0 comments on commit 2861144

Please sign in to comment.