Skip to content

Commit 480cfa7

Browse files
committed
Sort -t output before it's printed
1 parent d140ae9 commit 480cfa7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

internal/options.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package internal
22

33
import (
44
"fmt"
5+
"sort"
56

67
"github.com/docopt/docopt-go"
78
)
@@ -72,8 +73,15 @@ func (opts Options) Handlers(p *Parseable) []OptionHandler {
7273
}
7374

7475
parser := (*p).(*parser)
75-
for taskName := range parser.Tasks {
76-
fmt.Println(taskName)
76+
tasks := make([]string, 0, len(parser.Tasks))
77+
78+
for k := range parser.Tasks {
79+
tasks = append(tasks, k)
80+
}
81+
sort.Strings(tasks)
82+
83+
for _, task := range tasks {
84+
fmt.Println(task)
7785
}
7886

7987
return 0, nil

0 commit comments

Comments
 (0)