MCPcopy Index your code
hub / github.com/docker/docker-agent / tuiOpts

Method tuiOpts

cmd/root/run.go:908–929  ·  view source on GitHub ↗

tuiOpts returns the TUI options derived from the current flags. args are the run command's positional arguments, used to detect an initial message.

(args []string)

Source from the content-addressed store, hash-verified

906// tuiOpts returns the TUI options derived from the current flags. args are
907// the run command's positional arguments, used to detect an initial message.
908func (f *runExecFlags) tuiOpts(args []string) []tui.Option {
909 var opts []tui.Option
910 if f.lean {
911 opts = append(opts, tui.WithLeanMode())
912 }
913 if f.appName != "" {
914 opts = append(opts, tui.WithAppName(f.appName))
915 }
916 if len(f.disabledCommands) > 0 {
917 opts = append(opts, tui.WithDisabledCommands(f.disabledCommands))
918 }
919 if !f.sidebar {
920 opts = append(opts, tui.WithHideSidebar())
921 }
922 switch {
923 case f.tour:
924 opts = append(opts, tui.WithTourStart())
925 case f.shouldOfferTour(args):
926 opts = append(opts, tui.WithTourOffer(telemetry.GetTelemetryEnabled()))
927 }
928 return opts
929}
930
931// shouldOfferTour reports whether this interactive run should show the
932// first-run dialog offering the getting-started tour. Automation and

Callers 1

runOrExecMethod · 0.95

Calls 8

shouldOfferTourMethod · 0.95
WithLeanModeFunction · 0.92
WithAppNameFunction · 0.92
WithDisabledCommandsFunction · 0.92
WithHideSidebarFunction · 0.92
WithTourStartFunction · 0.92
WithTourOfferFunction · 0.92
GetTelemetryEnabledFunction · 0.92

Tested by

no test coverage detected