MCPcopy Create free account
hub / github.com/carvel-dev/kapp-controller / configureTTY

Function configureTTY

cli/pkg/kctrl/cmd/kctrl.go:164–176  ·  view source on GitHub ↗
(o *KctrlOptions, cmd *cobra.Command)

Source from the content-addressed store, hash-verified

162}
163
164func configureTTY(o *KctrlOptions, cmd *cobra.Command) {
165 configureTTYFlag := func(cmd *cobra.Command) {
166 var forceTTY bool
167
168 _, defaultTTY := cmd.Annotations[app.TTYByDefaultKey]
169 cmd.Flags().BoolVar(&forceTTY, "tty", defaultTTY, "Force TTY-like output")
170 cobrautil.VisitCommands(cmd, cobrautil.WrapRunEForCmd(func(*cobra.Command, []string) error {
171 o.ui.EnableTTY(forceTTY)
172 return nil
173 }))
174 }
175 cobrautil.VisitCommands(cmd, cobrautil.ReconfigureLeafCmds(configureTTYFlag))
176}
177
178func AddPackageCommands(o *KctrlOptions, cmd *cobra.Command, flagsFactory cmdcore.FlagsFactory, opts cmdcore.PackageCommandTreeOpts) {
179 pkgrepoCmd := pkgrepo.NewCmd()

Callers 2

NewKctrlCmdFunction · 0.85
AttachGlobalFlagsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected