From 6a586992c117bd34c69ca6747ac0c0f101c6ea89 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Thu, 23 Apr 2020 09:38:35 -0700 Subject: V2 restore podman -v command * Removed extra spaces and improved error message * Updated tests to use gomega matchers Signed-off-by: Jhon Honce --- cmd/podman/registry/registry.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/podman/registry/registry.go') diff --git a/cmd/podman/registry/registry.go b/cmd/podman/registry/registry.go index 2e9d59d10..993b14cbc 100644 --- a/cmd/podman/registry/registry.go +++ b/cmd/podman/registry/registry.go @@ -2,6 +2,7 @@ package registry import ( "context" + "fmt" "github.com/containers/libpod/pkg/domain/entities" "github.com/containers/libpod/pkg/domain/infra" @@ -86,7 +87,7 @@ func SubCommandExists(cmd *cobra.Command, args []string) error { // IdOrLatestArgs used to validate a nameOrId was provided or the "--latest" flag func IdOrLatestArgs(cmd *cobra.Command, args []string) error { if len(args) > 1 || (len(args) == 0 && !cmd.Flag("latest").Changed) { - return errors.New(`command requires a name, id or the "--latest" flag`) + return fmt.Errorf("%s requires a name, id or the '--latest' flag", cmd.Name()) } return nil } -- cgit v1.2.3-54-g00ecf