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
1 changed files with 3 additions and 2 deletions

View File

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