diff --git a/vendor/github.com/minio/cli/README.md b/vendor/github.com/minio/cli/README.md index bb5f61ea..2bbbd8ea 100644 --- a/vendor/github.com/minio/cli/README.md +++ b/vendor/github.com/minio/cli/README.md @@ -455,13 +455,13 @@ error. Flags for the application and commands are shown in the order they are defined. However, it's possible to sort them from outside this library by using `FlagsByName` -with `sort`. +or `CommandsByName` with `sort`. For example this: ``` go package main @@ -488,7 +488,27 @@ func main() { }, } + app.Commands = []cli.Command{ + { + Name: "complete", + Aliases: []string{"c"}, + Usage: "complete a task on the list", + Action: func(c *cli.Context) error { + return nil + }, + }, + { + Name: "add", + Aliases: []string{"a"}, + Usage: "add a task to the list", + Action: func(c *cli.Context) error { + return nil + }, + }, + } + sort.Sort(cli.FlagsByName(app.Flags)) + sort.Sort(cli.CommandsByName(app.Commands)) app.Run(os.Args) } @@ -940,16 +960,13 @@ SUPPORT: support@awesometown.example.com cli.AppHelpTemplate = `NAME: {{.Name}} - {{.Usage}} USAGE: - {{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command -[command options]{{end}} {{if -.ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}} + {{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}} {{if len .Authors}} -AUTHOR(S): +AUTHOR: {{range .Authors}}{{ . }}{{end}} {{end}}{{if .Commands}} COMMANDS: -{{range .Commands}}{{if not .HideHelp}} {{join .Names ", "}}{{ "\t" -}}{{.Usage}}{{ "\n" }}{{end}}{{end}}{{end}}{{if .VisibleFlags}} +{{range .Commands}}{{if not .HideHelp}} {{join .Names ", "}}{{ "\t"}}{{.Usage}}{{ "\n" }}{{end}}{{end}}{{end}}{{if .VisibleFlags}} GLOBAL OPTIONS: {{range .VisibleFlags}}{{.}} {{end}}{{end}}{{if .Copyright }} diff --git a/vendor/github.com/minio/cli/command.go b/vendor/github.com/minio/cli/command.go index 2f62a9a7..e1e49917 100644 --- a/vendor/github.com/minio/cli/command.go +++ b/vendor/github.com/minio/cli/command.go @@ -66,6 +66,20 @@ type Command struct { CustomHelpTemplate string } +type CommandsByName []Command + +func (c CommandsByName) Len() int { + return len(c) +} + +func (c CommandsByName) Less(i, j int) bool { + return c[i].Name < c[j].Name +} + +func (c CommandsByName) Swap(i, j int) { + c[i], c[j] = c[j], c[i] +} + // FullName returns the full name of the command. // For subcommands this ensures that parent commands are part of the command path func (c Command) FullName() string { diff --git a/vendor/vendor.json b/vendor/vendor.json index 29227234..5cbf6626 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -39,9 +39,9 @@ "revisionTime": "2015-12-11T09:06:21+09:00" }, { - "checksumSHA1": "4DYW5PdWgYVOFDVWm+vnu5T2OoE=", + "checksumSHA1": "+jYYwEFAR+NW42UwA/AeppFYTbs=", "path": "github.com/minio/cli", - "revision": "9636d96501d1d89ea3827c9df770320544399422", + "revision": "bf72f027481f5fadaf8800f62c72904e6bd7a200", "revisionTime": "2016-11-25T09:07:42Z" }, {