diff --git a/cmd/helm/helm.go b/cmd/helm/helm.go index c395d1f55..096a989f6 100644 --- a/cmd/helm/helm.go +++ b/cmd/helm/helm.go @@ -155,7 +155,7 @@ func newRootCmd() *cobra.Command { addFlagsTLS(newVersionCmd(nil, out)), newCompletionCmd(out), - newHomeCmd(), + newHomeCmd(out), newInitCmd(out), newPluginCmd(out), diff --git a/cmd/helm/home.go b/cmd/helm/home.go index abd7fb101..e96edd7a1 100644 --- a/cmd/helm/home.go +++ b/cmd/helm/home.go @@ -17,6 +17,9 @@ limitations under the License. package main import ( + "fmt" + "io" + "github.com/spf13/cobra" ) @@ -25,22 +28,22 @@ This command displays the location of HELM_HOME. This is where any helm configuration files live. ` -func newHomeCmd() *cobra.Command { +func newHomeCmd(out io.Writer) *cobra.Command { cmd := &cobra.Command{ Use: "home", Short: "displays the location of HELM_HOME", Long: longHomeHelp, Run: func(cmd *cobra.Command, args []string) { h := settings.Home - cmd.Println(h) + fmt.Fprintln(out, h) if settings.Debug { - cmd.Printf("Repository: %s\n", h.Repository()) - cmd.Printf("RepositoryFile: %s\n", h.RepositoryFile()) - cmd.Printf("Cache: %s\n", h.Cache()) - cmd.Printf("Stable CacheIndex: %s\n", h.CacheIndex("stable")) - cmd.Printf("Starters: %s\n", h.Starters()) - cmd.Printf("LocalRepository: %s\n", h.LocalRepository()) - cmd.Printf("Plugins: %s\n", h.Plugins()) + fmt.Fprintf(out, "Repository: %s\n", h.Repository()) + fmt.Fprintf(out, "RepositoryFile: %s\n", h.RepositoryFile()) + fmt.Fprintf(out, "Cache: %s\n", h.Cache()) + fmt.Fprintf(out, "Stable CacheIndex: %s\n", h.CacheIndex("stable")) + fmt.Fprintf(out, "Starters: %s\n", h.Starters()) + fmt.Fprintf(out, "LocalRepository: %s\n", h.LocalRepository()) + fmt.Fprintf(out, "Plugins: %s\n", h.Plugins()) } }, }