Added shorthand output formats

This commit is contained in:
Mike Farah
2021-08-20 15:46:33 +10:00
parent 10d4eb3381
commit d18aa3e9e0
3 changed files with 46 additions and 8 deletions
+3 -3
View File
@@ -27,11 +27,11 @@ const (
func OutputFormatFromString(format string) (PrinterOutputFormat, error) {
switch format {
case "yaml":
case "yaml", "y":
return YamlOutputFormat, nil
case "json":
case "json", "j":
return JsonOutputFormat, nil
case "props":
case "props", "p":
return PropsOutputFormat, nil
default:
return 0, fmt.Errorf("Unknown fromat '%v' please use [yaml|json|props]", format)