Merge pull request #258 from sthulb/unknown-command

Add unknown command help
This commit is contained in:
Evan Hazlett 2015-01-10 10:14:10 -08:00
commit 4c285dcffa
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