cli: fix bug with 'vault read -field=...' when the field value contains a printf formatting verb (#2109)

This commit is contained in:
Kyle McCullough
2016-11-22 11:30:23 -06:00
committed by Jeff Mitchell
parent 6165c3e20f
commit 9571df6bc6

View File

@@ -79,7 +79,7 @@ func PrintRawField(ui cli.Ui, secret *api.Secret, field string) int {
// directly print the message. If mitchellh/cli exposes method
// to print without CR, this check needs to be removed.
if reflect.TypeOf(ui).String() == "*cli.BasicUi" {
fmt.Fprintf(os.Stdout, fmt.Sprintf("%v", val))
fmt.Fprintf(os.Stdout, "%v", val)
} else {
ui.Output(fmt.Sprintf("%v", val))
}