MCPcopy
hub / github.com/helm/helm / newShowCmd

Function newShowCmd

pkg/cmd/show.go:60–191  ·  view source on GitHub ↗
(cfg *action.Configuration, out io.Writer)

Source from the content-addressed store, hash-verified

58`
59
60func 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

Callers 1

newRootCmdWithConfigFunction · 0.85

Calls 7

NewShowFunction · 0.92
ExactArgsFunction · 0.92
noMoreArgsCompFunction · 0.85
compListChartsFunction · 0.85
addRegistryClientFunction · 0.85
runShowFunction · 0.85
addShowFlagsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…