You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/batteries/options.go
+40-5Lines changed: 40 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ package batteries
18
18
19
19
import (
20
20
"fmt"
21
+
"os"
21
22
"strings"
22
23
23
24
"github.com/spf13/pflag"
@@ -50,18 +51,52 @@ func (s *Options) AddFlags(fs *pflag.FlagSet) {
50
51
return
51
52
}
52
53
53
-
bats:=sets.NewString()
54
-
forb:=rangedefaultBatteries {
55
-
bats=bats.Insert(string(b))
54
+
all:=sets.NewString()
55
+
enabled:=sets.NewString()
56
+
varmaxLenint
57
+
forname:=rangedefaultBatteries {
58
+
iflen(name) >maxLen {
59
+
maxLen=len(name)
60
+
}
56
61
}
57
-
fs.StringSliceVar(&s.Enabled, "batteries", []string{}, "The batteries to enable in the generic control-plane server. Possible values: "+strings.Join(bats.List(), ", "))
"The batteries to enable in the generic control-plane server ('-battery' to disable, '+battery' or 'battery' to enable).\n\nPossible values:\n- %s\n\nEnabled batteries: %s",
73
+
strings.Join(all.List(), "\n- "),
74
+
strings.Join(enabled.List(), ", "),
75
+
))
58
76
}
59
77
60
78
// Complete defaults fields that have not set by the consumer of this package.
61
79
func (bOptions) Complete() CompletedOptions {
62
80
// Ensure all related configurations are configured
0 commit comments