Show error if output format is invalid

Rather than silently using table as a fallback.
This commit is contained in:
Mathias Lafeldt 2015-12-14 17:13:20 +01:00
parent de0ddf4912
commit b00b476c7a

View file

@ -21,9 +21,10 @@ func OutputSecret(ui cli.Ui, format string, secret *api.Secret) int {
case "yaml":
return outputFormatYAML(ui, secret)
case "table":
fallthrough
default:
return outputFormatTable(ui, secret, true)
default:
ui.Error(fmt.Sprintf("Invalid output format: %s", format))
return 1
}
}