Skip to content
Myr

Merge pull request #92 from eparis/sort-valid-args

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Sort the valid args before output

authored by Eric Paris · committed by Eric Paris · parents c0da825, 0fc734c · Browse files · 1 file+2 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−0 removed

  • other:+2 added−0 removed

1 file+2 added−0 removed

modified:bash_completions.go+2 added
2 unmodified lines
3import (4 "bytes"5 "fmt"6 "os"7 "sort"8 "strings"910 "github.com/spf13/pflag"11)
270 unmodified lines
282}283284func writeRequiredNoun(cmd *Command, out *bytes.Buffer) {285 fmt.Fprintf(out, " must_have_one_noun=()\n")286 sort.Sort(sort.StringSlice(cmd.ValidArgs))287 for _, value := range cmd.ValidArgs {288 fmt.Fprintf(out, " must_have_one_noun+=(%q)\n", value)289 }290}
55 unmodified lines