mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
skip print section flags if no flags
This commit is contained in:
parent
a14673cfbd
commit
01195efbe3
@ -52,6 +52,9 @@ func (nfs *NamedFlagSets) FlagSet(name string) *pflag.FlagSet {
|
||||
func PrintSections(w io.Writer, fss NamedFlagSets, cols int) {
|
||||
for _, name := range fss.Order {
|
||||
fs := fss.FlagSets[name]
|
||||
if !fs.HasFlags() {
|
||||
continue
|
||||
}
|
||||
|
||||
wideFS := pflag.NewFlagSet("", pflag.ExitOnError)
|
||||
wideFS.AddFlagSet(fs)
|
||||
|
Loading…
Reference in New Issue
Block a user