diff --git a/cmd/helm/list.go b/cmd/helm/list.go index 50d54c363..a9cd6d996 100644 --- a/cmd/helm/list.go +++ b/cmd/helm/list.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "os" "github.com/codegangsta/cli" @@ -28,6 +27,5 @@ func list(host string) error { if err != nil { return err } - fmt.Println(list) - return nil + return format.YAML(list) } diff --git a/format/messages.go b/format/messages.go index b1c63d510..1d2a8b0e1 100644 --- a/format/messages.go +++ b/format/messages.go @@ -3,6 +3,8 @@ package format import ( "fmt" "os" + + "github.com/ghodss/yaml" ) // This is all just placeholder. @@ -35,3 +37,13 @@ func Warning(msg string, v ...interface{}) { msg = "[Warning] " + msg + "\n" fmt.Fprintf(os.Stdout, msg, v...) } + +func YAML(v interface{}) error { + y, err := yaml.Marshal(v) + if err != nil { + return fmt.Errorf("Failed to serialize to yaml: %s", v.(string)) + } + + Msg(string(y)) + return nil +}