mirror of https://github.com/docker/cli.git
Merge pull request #2735 from thaJeztah/fix_flag_hiding
Fix buildkit flags not being hidden without buildkit enabled
This commit is contained in:
commit
5695d699ae
|
@ -322,8 +322,12 @@ func hideFlagIf(f *pflag.Flag, condition func(string) bool, annotation string) {
|
||||||
if f.Hidden {
|
if f.Hidden {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if values, ok := f.Annotations[annotation]; ok && len(values) > 0 {
|
var val string
|
||||||
if condition(values[0]) {
|
if values, ok := f.Annotations[annotation]; ok {
|
||||||
|
if len(values) > 0 {
|
||||||
|
val = values[0]
|
||||||
|
}
|
||||||
|
if condition(val) {
|
||||||
f.Hidden = true
|
f.Hidden = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue