MCPcopy Create free account
hub / github.com/cloudfoundry/cli / Execute

Method Execute

cf/commands/featureflag/feature_flags.go:56–82  ·  view source on GitHub ↗
(c flags.FlagContext)

Source from the content-addressed store, hash-verified

54}
55
56func (cmd *ListFeatureFlags) Execute(c flags.FlagContext) error {
57 cmd.ui.Say(T("Retrieving status of all flagged features as {{.Username}}...", map[string]interface{}{
58 "Username": terminal.EntityNameColor(cmd.config.Username())}))
59
60 flags, err := cmd.flagRepo.List()
61 if err != nil {
62 return err
63 }
64
65 cmd.ui.Ok()
66 cmd.ui.Say("")
67
68 table := cmd.ui.Table([]string{T("Features"), T("State")})
69
70 for _, flag := range flags {
71 table.Add(
72 flag.Name,
73 cmd.flagBoolToString(flag.Enabled),
74 )
75 }
76
77 err = table.Print()
78 if err != nil {
79 return err
80 }
81 return nil
82}
83
84func (cmd ListFeatureFlags) flagBoolToString(enabled bool) string {
85 if enabled {

Callers

nothing calls this directly

Calls 9

flagBoolToStringMethod · 0.95
EntityNameColorFunction · 0.92
SayMethod · 0.65
UsernameMethod · 0.65
ListMethod · 0.65
OkMethod · 0.65
TableMethod · 0.65
AddMethod · 0.65
PrintMethod · 0.65

Tested by

no test coverage detected