fix(version): implement `helm version -c`, mark as hidden

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
pull/7423/head
Matthew Fisher 5 years ago
parent 166092fd7e
commit 34b2bd68dc
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -0,0 +1 @@
version.BuildInfo{Version:"v3.0", GitCommit:"", GitTreeState:"", GoVersion:""}

@ -0,0 +1 @@
version.BuildInfo{Version:"v3.0", GitCommit:"", GitTreeState:"", GoVersion:""}

@ -61,6 +61,8 @@ func newVersionCmd(out io.Writer) *cobra.Command {
f := cmd.Flags() f := cmd.Flags()
f.BoolVar(&o.short, "short", false, "print the version number") f.BoolVar(&o.short, "short", false, "print the version number")
f.StringVar(&o.template, "template", "", "template for version string format") f.StringVar(&o.template, "template", "", "template for version string format")
f.BoolP("client", "c", true, "display client version information")
f.MarkHidden("client")
return cmd return cmd
} }

@ -32,6 +32,14 @@ func TestVersion(t *testing.T) {
name: "template", name: "template",
cmd: "version --template='Version: {{.Version}}'", cmd: "version --template='Version: {{.Version}}'",
golden: "output/version-template.txt", golden: "output/version-template.txt",
}, {
name: "client",
cmd: "version --client",
golden: "output/version-client.txt",
}, {
name: "client shorthand",
cmd: "version -c",
golden: "output/version-client-shorthand.txt",
}} }}
runTestCmd(t, tests) runTestCmd(t, tests)
} }

Loading…
Cancel
Save