Skip to content

Commit

Permalink
Merge pull request #207 from Random-Liu/sort-flags
Browse files Browse the repository at this point in the history
Sort flags for all commands.
  • Loading branch information
feiskyer authored Nov 30, 2017
2 parents 80a7c13 + d9b4439 commit 0a9595c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/crictl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"net"
"os"
"sort"
"time"

"github.com/Sirupsen/logrus"
Expand Down Expand Up @@ -200,6 +201,12 @@ func main() {
}
return nil
}
// sort all flags
for _, cmd := range app.Commands {
sort.Sort(cli.FlagsByName(cmd.Flags))
}
sort.Sort(cli.FlagsByName(app.Flags))

if err := app.Run(os.Args); err != nil {
logrus.Fatal(err)
}
Expand Down

0 comments on commit 0a9595c

Please sign in to comment.