File tree Expand file tree Collapse file tree 1 file changed +7
-28
lines changed Expand file tree Collapse file tree 1 file changed +7
-28
lines changed Original file line number Diff line number Diff line change @@ -317,35 +317,14 @@ func optionText(cmd ...*cmds.Command) []string {
317
317
}
318
318
}
319
319
320
- // add option names to output (with each name aligned)
321
- lines := make ([]string , 0 )
322
- j := 0
323
- for {
324
- done := true
325
- i := 0
326
- for _ , opt := range options {
327
- if len (lines ) < i + 1 {
328
- lines = append (lines , "" )
329
- }
330
-
331
- names := sortByLength (opt .Names ())
332
- if len (names ) >= j + 1 {
333
- lines [i ] += optionFlag (names [j ])
334
- }
335
- if len (names ) > j + 1 {
336
- lines [i ] += ", "
337
- done = false
338
- }
339
-
340
- i ++
341
- }
342
-
343
- if done {
344
- break
320
+ // add option names to output
321
+ lines := make ([]string , len (options ))
322
+ for i , opt := range options {
323
+ flags := sortByLength (opt .Names ())
324
+ for j , f := range flags {
325
+ flags [j ] = optionFlag (f )
345
326
}
346
-
347
- lines = align (lines )
348
- j ++
327
+ lines [i ] = strings .Join (flags , ", " )
349
328
}
350
329
lines = align (lines )
351
330
You can’t perform that action at this time.
0 commit comments