github.com/latiif/helm@v2.15.0+incompatible/cmd/helm/home.go (about)

     1  /*
     2  Copyright The Helm Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package main
    18  
    19  import (
    20  	"fmt"
    21  	"io"
    22  
    23  	"github.com/spf13/cobra"
    24  )
    25  
    26  var longHomeHelp = `
    27  This command displays the location of HELM_HOME. This is where
    28  any helm configuration files live.
    29  `
    30  
    31  func newHomeCmd(out io.Writer) *cobra.Command {
    32  	cmd := &cobra.Command{
    33  		Use:   "home",
    34  		Short: "Displays the location of HELM_HOME",
    35  		Long:  longHomeHelp,
    36  		Run: func(cmd *cobra.Command, args []string) {
    37  			h := settings.Home
    38  			fmt.Fprintln(out, h)
    39  			if settings.Debug {
    40  				fmt.Fprintf(out, "Repository: %s\n", h.Repository())
    41  				fmt.Fprintf(out, "RepositoryFile: %s\n", h.RepositoryFile())
    42  				fmt.Fprintf(out, "Cache: %s\n", h.Cache())
    43  				fmt.Fprintf(out, "Stable CacheIndex: %s\n", h.CacheIndex("stable"))
    44  				fmt.Fprintf(out, "Starters: %s\n", h.Starters())
    45  				fmt.Fprintf(out, "LocalRepository: %s\n", h.LocalRepository())
    46  				fmt.Fprintf(out, "Plugins: %s\n", h.Plugins())
    47  			}
    48  		},
    49  	}
    50  	return cmd
    51  }