2014-08-01 13:34:06 -04:00
|
|
|
package main
|
|
|
|
|
2015-10-08 08:46:21 -04:00
|
|
|
import (
|
|
|
|
"sort"
|
|
|
|
|
|
|
|
"github.com/docker/docker/cli"
|
|
|
|
flag "github.com/docker/docker/pkg/mflag"
|
|
|
|
)
|
2014-08-01 13:34:06 -04:00
|
|
|
|
2015-05-05 00:18:28 -04:00
|
|
|
var (
|
|
|
|
flHelp = flag.Bool([]string{"h", "-help"}, false, "Print usage")
|
|
|
|
flVersion = flag.Bool([]string{"v", "-version"}, false, "Print version information and quit")
|
2014-08-01 13:34:06 -04:00
|
|
|
)
|
|
|
|
|
2015-10-08 08:46:21 -04:00
|
|
|
type byName []cli.Command
|
2015-05-07 19:18:13 -04:00
|
|
|
|
|
|
|
func (a byName) Len() int { return len(a) }
|
|
|
|
func (a byName) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
2015-10-08 08:46:21 -04:00
|
|
|
func (a byName) Less(i, j int) bool { return a[i].Name < a[j].Name }
|
|
|
|
|
|
|
|
var dockerCommands []cli.Command
|
2015-05-07 19:18:13 -04:00
|
|
|
|
2015-05-05 00:18:28 -04:00
|
|
|
// TODO(tiborvass): do not show 'daemon' on client-only binaries
|
2015-10-08 08:46:21 -04:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
for _, cmd := range cli.DockerCommands {
|
|
|
|
dockerCommands = append(dockerCommands, cmd)
|
|
|
|
}
|
|
|
|
sort.Sort(byName(dockerCommands))
|
2014-08-01 13:34:06 -04:00
|
|
|
}
|