--- a/cmd/utils.go Sun May 07 11:56:37 2017 +0200
+++ b/cmd/utils.go Sun May 07 13:06:47 2017 +0200
@@ -45,7 +45,7 @@
// getPrinter returns a resource printer for the requested output format.
func getPrinter() (printer.ResourcePrinter, error) {
- var opt string
+ opt := make(printer.Options)
of := getOutputFormat()
// Initialize color mode
@@ -57,13 +57,13 @@
}
if of == "template" {
- opt = outputTemplate
+ opt["template"] = outputTemplate
if outputTemplateFile != "" {
tmpl, err := readTemplate(outputTemplateFile, viper.GetString("template_directory"))
if err != nil {
return nil, err
}
- opt = string(tmpl)
+ opt["template"] = string(tmpl)
}
}
return printer.NewPrinter(of, opt)