From f90b80969641f0aaca212004b8f6b90fd4319a87 Mon Sep 17 00:00:00 2001 From: Stephane Derosiaux Date: Wed, 28 Aug 2024 11:34:44 +0100 Subject: [PATCH] Fix --- cmd/get.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/get.go b/cmd/get.go index 8ffdb4c..bce25df 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -28,6 +28,10 @@ var OutputFormatIds = map[OutputFormat][]string{ NAME: {"name"}, } +func (o OutputFormat) String() string { + return OutputFormatIds[o][0] +} + var getCmd = &cobra.Command{ Use: "get", Short: "Get resource of a given kind", @@ -101,7 +105,7 @@ func printResource(result interface{}, format OutputFormat) error { return fmt.Errorf("unexpected resource type") } default: - return fmt.Errorf("invalid output format %s.\n", format) + return fmt.Errorf("invalid output format %s", format.String()) } return nil }