(cfg *action.Configuration, out io.Writer)
| 58 | ` |
| 59 | |
| 60 | func newShowCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { |
| 61 | client := action.NewShow(action.ShowAll, cfg) |
| 62 | |
| 63 | showCommand := &cobra.Command{ |
| 64 | Use: "show", |
| 65 | Short: "show information of a chart", |
| 66 | Aliases: []string{"inspect"}, |
| 67 | Long: showDesc, |
| 68 | Args: require.NoArgs, |
| 69 | } |
| 70 | |
| 71 | // Function providing dynamic auto-completion |
| 72 | validArgsFunc := func(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 73 | if len(args) != 0 { |
| 74 | return noMoreArgsComp() |
| 75 | } |
| 76 | return compListCharts(toComplete, true) |
| 77 | } |
| 78 | |
| 79 | all := &cobra.Command{ |
| 80 | Use: "all [CHART]", |
| 81 | Short: "show all information of the chart", |
| 82 | Long: showAllDesc, |
| 83 | Args: require.ExactArgs(1), |
| 84 | ValidArgsFunction: validArgsFunc, |
| 85 | RunE: func(_ *cobra.Command, args []string) error { |
| 86 | client.OutputFormat = action.ShowAll |
| 87 | err := addRegistryClient(out, client) |
| 88 | if err != nil { |
| 89 | return err |
| 90 | } |
| 91 | output, err := runShow(args, client) |
| 92 | if err != nil { |
| 93 | return err |
| 94 | } |
| 95 | fmt.Fprint(out, output) |
| 96 | return nil |
| 97 | }, |
| 98 | } |
| 99 | |
| 100 | valuesSubCmd := &cobra.Command{ |
| 101 | Use: "values [CHART]", |
| 102 | Short: "show the chart's values", |
| 103 | Long: showValuesDesc, |
| 104 | Args: require.ExactArgs(1), |
| 105 | ValidArgsFunction: validArgsFunc, |
| 106 | RunE: func(_ *cobra.Command, args []string) error { |
| 107 | client.OutputFormat = action.ShowValues |
| 108 | err := addRegistryClient(out, client) |
| 109 | if err != nil { |
| 110 | return err |
| 111 | } |
| 112 | output, err := runShow(args, client) |
| 113 | if err != nil { |
| 114 | return err |
| 115 | } |
| 116 | fmt.Fprint(out, output) |
| 117 | return nil |
no test coverage detected
searching dependent graphs…