Skip to content

Commit

Permalink
fix: make pouch network non-existent return exit code 1
Browse files Browse the repository at this point in the history
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
  • Loading branch information
allencloud committed Apr 10, 2018
1 parent b20c202 commit 6c5b82a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cli/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down
3 changes: 3 additions & 0 deletions cli/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down

0 comments on commit 6c5b82a

Please sign in to comment.