@ -29,19 +29,19 @@ import (
"k8s.io/helm/pkg/chart/loader"
)
const inspect Desc = `
const show Desc = `
This command inspects a chart and displays information . It takes a chart reference
( ' stable / drupal ' ) , a full path to a directory or packaged chart , or a URL .
Inspect prints the contents of the Chart . yaml file and the values . yaml file .
`
const inspect ValuesDesc = `
const show ValuesDesc = `
This command inspects a chart ( directory , file , or URL ) and displays the contents
of the values . yaml file
`
const inspect ChartDesc = `
const show ChartDesc = `
This command inspects a chart ( directory , file , or URL ) and displays the contents
of the Charts . yaml file
`
@ -51,7 +51,7 @@ This command inspects a chart (directory, file, or URL) and displays the content
of the README file
`
type inspect Options struct {
type show Options struct {
chartpath string
output string
@ -67,13 +67,14 @@ const (
var readmeFileNames = [ ] string { "readme.md" , "readme.txt" , "readme" }
func new Inspect Cmd( out io . Writer ) * cobra . Command {
o := & inspect Options{ output : all }
func new Show Cmd( out io . Writer ) * cobra . Command {
o := & show Options{ output : all }
inspect Command := & cobra . Command {
Use : "inspect [CHART]",
show Command := & cobra . Command {
Use : "show [CHART]",
Short : "inspect a chart" ,
Long : inspectDesc ,
Aliases : [ ] string { "inspect" } ,
Long : showDesc ,
Args : require . ExactArgs ( 1 ) ,
RunE : func ( cmd * cobra . Command , args [ ] string ) error {
cp , err := o . locateChart ( args [ 0 ] )
@ -87,8 +88,8 @@ func newInspectCmd(out io.Writer) *cobra.Command {
valuesSubCmd := & cobra . Command {
Use : "values [CHART]" ,
Short : "shows inspect values",
Long : inspect ValuesDesc,
Short : "shows values for this chart ",
Long : show ValuesDesc,
Args : require . ExactArgs ( 1 ) ,
RunE : func ( cmd * cobra . Command , args [ ] string ) error {
o . output = valuesOnly
@ -103,8 +104,8 @@ func newInspectCmd(out io.Writer) *cobra.Command {
chartSubCmd := & cobra . Command {
Use : "chart [CHART]" ,
Short : "shows inspec t chart",
Long : inspect ChartDesc,
Short : "shows the chart",
Long : show ChartDesc,
Args : require . ExactArgs ( 1 ) ,
RunE : func ( cmd * cobra . Command , args [ ] string ) error {
o . output = chartOnly
@ -119,7 +120,7 @@ func newInspectCmd(out io.Writer) *cobra.Command {
readmeSubCmd := & cobra . Command {
Use : "readme [CHART]" ,
Short : "shows inspect readme ",
Short : "shows the chart's README ",
Long : readmeChartDesc ,
Args : require . ExactArgs ( 1 ) ,
RunE : func ( cmd * cobra . Command , args [ ] string ) error {
@ -133,19 +134,19 @@ func newInspectCmd(out io.Writer) *cobra.Command {
} ,
}
cmds := [ ] * cobra . Command { inspect Command, readmeSubCmd , valuesSubCmd , chartSubCmd }
cmds := [ ] * cobra . Command { show Command, readmeSubCmd , valuesSubCmd , chartSubCmd }
for _ , subCmd := range cmds {
o . chartPathOptions . addFlags ( subCmd . Flags ( ) )
}
for _ , subCmd := range cmds [ 1 : ] {
inspect Command. AddCommand ( subCmd )
show Command. AddCommand ( subCmd )
}
return inspect Command
return show Command
}
func ( i * inspect Options) run ( out io . Writer ) error {
func ( i * show Options) run ( out io . Writer ) error {
chrt , err := loader . Load ( i . chartpath )
if err != nil {
return err