Commit f1505486 authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #18256 from caesarxuchao/fix-17266

Auto commit by PR queue bot
parents 3d24d25f c07c9dd4
...@@ -74,6 +74,8 @@ func (v *versionValue) Type() string { ...@@ -74,6 +74,8 @@ func (v *versionValue) Type() string {
func VersionVar(p *versionValue, name string, value versionValue, usage string) { func VersionVar(p *versionValue, name string, value versionValue, usage string) {
*p = value *p = value
flag.Var(p, name, usage) flag.Var(p, name, usage)
// "--version" will be treated as "--version=true"
flag.Lookup(name).NoOptDefVal = "true"
} }
func Version(name string, value versionValue, usage string) *versionValue { func Version(name string, value versionValue, usage string) *versionValue {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment