Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sderosiaux committed Aug 28, 2024
1 parent 6eab9ae commit f90b809
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit f90b809

Please sign in to comment.