Skip to content

Commit

Permalink
Throw help when a command which does not exist is executed
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Oct 17, 2019
1 parent 7c935e2 commit e8bdbb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmd/cmd.go
Expand Up @@ -260,6 +260,11 @@ func Setup(app *ccli.App, options ...micro.Option) {
app.Action = func(context *ccli.Context) {
log.Name("micro")

if len(context.Args()) > 0 {
ccli.ShowSubcommandHelp(context)
os.Exit(1)
}

// get the network flag
network := context.GlobalString("network")

Expand Down
1 change: 0 additions & 1 deletion internal/command/cli/command.go
Expand Up @@ -286,7 +286,6 @@ func NetworkConnect(c *cli.Context, args []string) ([]byte, error) {
return b, nil
}


func NetworkGraph(c *cli.Context) ([]byte, error) {
cli := *cmd.DefaultOptions().Client

Expand Down

0 comments on commit e8bdbb2

Please sign in to comment.