Add unknown command help

Spits out "machine: '<command>' is not a machine command see 'machine
--help'" to be inline with Docker

Signed-off-by: Simon Thulbourn <simon+github@thulbourn.com>
This commit is contained in:
Simon Thulbourn 2015-01-09 23:38:59 +00:00
parent e1da47b7ca
commit c8b36dfbfc
2 changed files with 11 additions and 0 deletions

View File

@ -380,6 +380,16 @@ func cmdUrl(c *cli.Context) {
fmt.Println(url)
}
func cmdNotFound(c *cli.Context, command string) {
log.Fatalf(
"%s: '%s' is not a %s command. See '%s --help'.",
c.App.Name,
command,
c.App.Name,
c.App.Name,
)
}
func getHost(c *cli.Context) *Host {
name := c.Args().First()
store := NewStore(c.GlobalString("storage-path"))

View File

@ -18,6 +18,7 @@ func main() {
app := cli.NewApp()
app.Name = "machine"
app.Commands = Commands
app.CommandNotFound = cmdNotFound
app.Usage = "Create and manage machines running Docker."
app.Version = VERSION