Update cobra to sort autogen code

We need determinism for hack/verify-gendocs.sh
This commit is contained in:
Eric Paris
2015-04-13 19:06:49 -04:00
parent 7464575b17
commit 5b8a426d01
2 changed files with 3 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"os"
"sort"
"strings"
"github.com/spf13/pflag"
@@ -282,6 +283,7 @@ func writeRequiredFlag(cmd *Command, out *bytes.Buffer) {
func writeRequiredNoun(cmd *Command, out *bytes.Buffer) {
fmt.Fprintf(out, " must_have_one_noun=()\n")
sort.Sort(sort.StringSlice(cmd.ValidArgs))
for _, value := range cmd.ValidArgs {
fmt.Fprintf(out, " must_have_one_noun+=(%q)\n", value)
}