commit
0b45bfcb36
1 changed files with 17 additions and 0 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"sort"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/kubernetes-incubator/cri-o/server"
|
||||
|
@ -58,6 +59,18 @@ func mergeConfig(config *server.Config, ctx *cli.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
type byName []cli.Flag
|
||||
|
||||
func (f byName) Len() int {
|
||||
return len(f)
|
||||
}
|
||||
func (f byName) Less(i, j int) bool {
|
||||
return f[i].GetName() < f[j].GetName()
|
||||
}
|
||||
func (f byName) Swap(i, j int) {
|
||||
f[i], f[j] = f[j], f[i]
|
||||
}
|
||||
|
||||
func main() {
|
||||
app := cli.NewApp()
|
||||
app.Name = "ocid"
|
||||
|
@ -121,6 +134,10 @@ func main() {
|
|||
},
|
||||
}
|
||||
|
||||
// remove once https://github.com/urfave/cli/pull/544 lands
|
||||
sort.Sort(byName(app.Flags))
|
||||
sort.Sort(byName(configCommand.Flags))
|
||||
|
||||
app.Commands = []cli.Command{
|
||||
configCommand,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue