Documentation
¶
Index ¶
- func WithApp(ctx context.Context, app *App) context.Context
- type App
- func (a *App) ApplyFlags()
- func (a *App) CalDAV() (*caldav.Client, error)
- func (a *App) Err(err error) error
- func (a *App) IsInteractive() bool
- func (a *App) IsMachineOutput() bool
- func (a *App) JMAP() (*jmap.Client, error)
- func (a *App) OK(data any, opts ...output.ResponseOption) error
- func (a *App) WebDAV() (*webdav.Client, error)
- type GlobalFlags
- type PrintedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
Config *config.Config
Auth *auth.Manager
Output *output.Writer
Flags GlobalFlags
// contains filtered or unexported fields
}
App holds the shared application context for all commands.
func FromContext ¶
FromContext retrieves the App from a context.
func (*App) ApplyFlags ¶
func (a *App) ApplyFlags()
ApplyFlags applies global flag values and config to configure the app. Priority: explicit flags > config file values > defaults.
func (*App) CalDAV ¶
CalDAV returns the CalDAV client, creating it lazily. Requires DAV credentials (App Password); returns ErrDAVNotConfigured when credentials are missing, or the original error for other failures.
func (*App) Err ¶
Err outputs a structured error response to stderr AND returns a PrintedError wrapping the original so cobra gets a non-zero exit code while Execute() knows it was already printed.
func (*App) IsInteractive ¶
IsInteractive returns true if the terminal supports interactive input.
func (*App) IsMachineOutput ¶
IsMachineOutput returns true if output is for automation.
type GlobalFlags ¶
type GlobalFlags struct {
JSON bool
Quiet bool
MD bool
Styled bool
IDsOnly bool
Count bool
Agent bool
JQFilter string
Mailbox string
Verbose int
Stats bool
NoStats bool
Hints bool
NoHints bool
CacheDir string
}
GlobalFlags holds values for global CLI flags.
type PrintedError ¶
type PrintedError struct {
Cause error
}
PrintedError wraps an error that has already been printed to the user.
func (*PrintedError) Error ¶
func (e *PrintedError) Error() string
func (*PrintedError) Unwrap ¶
func (e *PrintedError) Unwrap() error