Documentation
¶
Index ¶
- Constants
- func Decide(args []string) (printVersion bool, textPath string)
- func ExitCode(err error) int
- func NewRoot(opts ...Option) *cobra.Command
- type ExitError
- type Option
- func WithCodeLoader(load func(string) (string, error)) Option
- func WithHistoryLoader(load func() []storage.Record) Option
- func WithHomeRunner(run func(context.Context, string, string) error) Option
- func WithModelRunner(run func(context.Context, tea.Model) error) Option
- func WithSettingsStore(load func() config.Settings, save func(config.Settings) error) Option
- func WithStdin(stdin io.Reader) Option
- func WithWriters(stdout, stderr io.Writer) Option
Constants ¶
View Source
const ( ExitOK = 0 ExitUsage = 1 ExitIO = 2 ExitAbort = 3 ExitInternal = 4 ExitManagedInstall = 5 // `update` refused: binary is managed by brew / go install )
Variables ¶
This section is empty.
Functions ¶
func Decide ¶
Decide maps root-level legacy args to startup decisions. It is pure: no os.Exit, no I/O, no usage dump.
Types ¶
type Option ¶
type Option func(*env)
func WithHistoryLoader ¶
func WithSettingsStore ¶
func WithWriters ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.