fix(helm): make install ouput similar to others

This now uses the global verbose flag (instead of a local one) and
formats the output in roughly the same style that 'helm list' and
'helm repo *' use.
pull/671/head
Matt Butcher 9 years ago
parent 6869258cfa
commit e24be19e9c

@ -31,8 +31,6 @@ var (
installArg string installArg string
// tillerHost overrides TILLER_HOST envVar // tillerHost overrides TILLER_HOST envVar
tillerHost string tillerHost string
// verbose enables verbose output
verbose bool
// installDryRun performs a dry-run install // installDryRun performs a dry-run install
installDryRun bool installDryRun bool
) )
@ -64,11 +62,13 @@ func printRelease(rel *release.Release) {
if rel == nil { if rel == nil {
return return
} }
fmt.Printf("release.name: %s\n", rel.Name) if flagVerbose {
if verbose { fmt.Printf("NAME: %s\n", rel.Name)
fmt.Printf("release.info: %s %s\n", timeconv.Format(rel.Info.LastDeployed, time.ANSIC), rel.Info.Status) fmt.Printf("INFO: %s %s\n", timeconv.Format(rel.Info.LastDeployed, time.ANSIC), rel.Info.Status)
fmt.Printf("release.chart: %s %s\n", rel.Chart.Metadata.Name, rel.Chart.Metadata.Version) fmt.Printf("CHART: %s %s\n", rel.Chart.Metadata.Name, rel.Chart.Metadata.Version)
fmt.Printf("release.manifest: %s\n", rel.Manifest) fmt.Printf("MANIFEST: %s\n", rel.Manifest)
} else {
fmt.Println(rel.Name)
} }
} }
@ -99,7 +99,6 @@ func fatalf(format string, args ...interface{}) {
func init() { func init() {
installCmd.Flags().StringVar(&tillerHost, "host", defaultHost, "address of tiller server") installCmd.Flags().StringVar(&tillerHost, "host", defaultHost, "address of tiller server")
installCmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "enable verbose install")
installCmd.Flags().BoolVar(&installDryRun, "dry-run", false, "simulate an install") installCmd.Flags().BoolVar(&installDryRun, "dry-run", false, "simulate an install")
RootCommand.AddCommand(installCmd) RootCommand.AddCommand(installCmd)

Loading…
Cancel
Save