From 6c5b82ab39ca341bc9567bd02b040f7b6eb0fb5c Mon Sep 17 00:00:00 2001 From: Allen Sun Date: Tue, 10 Apr 2018 14:56:53 +0800 Subject: [PATCH] fix: make pouch network non-existent return exit code 1 Signed-off-by: Allen Sun --- cli/network.go | 3 +++ cli/volume.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cli/network.go b/cli/network.go index 154ec9cd63..46db232660 100644 --- a/cli/network.go +++ b/cli/network.go @@ -32,6 +32,9 @@ func (n *NetworkCommand) Init(c *Cli) { Short: "Manage pouch networks", Long: networkDescription, Args: cobra.MinimumNArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + return fmt.Errorf("command 'pouch network %s' does not exist.\nPlease execute `pouch network --help` for more help", args[0]) + }, } c.AddCommand(n, &NetworkCreateCommand{}) diff --git a/cli/volume.go b/cli/volume.go index 02304158af..f1249e04cd 100644 --- a/cli/volume.go +++ b/cli/volume.go @@ -32,6 +32,9 @@ func (v *VolumeCommand) Init(c *Cli) { Short: "Manage pouch volumes", Long: volumeDescription, Args: cobra.MinimumNArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + return fmt.Errorf("command 'pouch volume %s' does not exist.\nPlease execute `pouch volume --help` for more help", args[0]) + }, } c.AddCommand(v, &VolumeCreateCommand{})