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)
| 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. |
| 908 | func (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 |
no test coverage detected