Documentation ¶
Index ¶
- Constants
- Variables
- func ActiveCommandNames() []string
- func CompletePath(path string, onlyDirs bool) []string
- func ExecuteCommand(cmd Command, cmdline string) error
- func ExpandTemplates(s string, cfg *config.AccountConfig, msg *models.MessageInfo) (string, error)
- func FilterList(valid []string, search string, postProc func(string) string) []string
- func GetAddress(search string) []string
- func GetCompletions(cmd Command, args *opt.Args) (options []opt.Completion, prefix string)
- func GetDateList() []string
- func GetFlagList() []string
- func GetFolders(arg string) []string
- func GetLabels(arg string) []string
- func GetTemplateCompletion(cmd string) ([]string, string, bool)
- func GetTemplates(arg string) []string
- func MarkedOrSelected(pm app.ProvidesMessages) ([]models.UID, error)
- func MsgInfoFromUids(store *lib.MessageStore, uids []models.UID, statusInfo func(string)) ([]*models.MessageInfo, error)
- func Operands(args []string, spec string) []string
- func QuickTerm(args []string, stdin io.Reader, silent bool) (*app.Terminal, error)
- func QuoteSpace(s string) string
- func Register(cmd Command)
- func TermCore(args []string) error
- func TermCoreDirectory(args []string, dir string) error
- func UidsFromMessageInfos(msgs []*models.MessageInfo) []models.UID
- func ZoxideAdd(arg string) error
- func ZoxideQuery(args []string) (string, error)
- type ChangeDirectory
- type ChangeTab
- type Choose
- type Close
- type Command
- type CommandContext
- type Echo
- type Eml
- type ErrorExit
- type ExecCmd
- type Help
- type Menu
- type MoveTab
- type NewAccount
- type NextPrevTab
- type NoSuchCommand
- type PinTab
- type PrintWorkDir
- type Prompt
- type Quit
- type Redraw
- type Reload
- type SendKeys
- type Suspend
- type Term
- type Zoxide
Constants ¶
const ( NONE = 1 << iota // available everywhere GLOBAL // only when a message list is focused MESSAGE_LIST // only when a message viewer is focused MESSAGE_VIEWER // only when a message composer is focused COMPOSE // only when a terminal TERMINAL )
Variables ¶
var CmdHistory = cmdHistory{}
CmdHistory is the history of executed commands
Functions ¶
func ActiveCommandNames ¶
func ActiveCommandNames() []string
func CompletePath ¶
CompletePath provides filesystem completions given a starting path.
func ExecuteCommand ¶
func ExpandTemplates ¶
func ExpandTemplates( s string, cfg *config.AccountConfig, msg *models.MessageInfo, ) (string, error)
expand template expressions
func FilterList ¶
FilterList takes a list of valid completions and filters it, either by case smart prefix, or by fuzzy matching An optional post processing function can be passed to prepend, append or quote each value.
func GetAddress ¶
GetAddress uses the address-book-cmd for address completion
func GetCompletions ¶
GetCompletions returns the completion options and the command prefix
func GetDateList ¶
func GetDateList() []string
GetDateList returns a list of date terms for completion
func GetFlagList ¶
func GetFlagList() []string
GetFlagList returns a list of available flags for completion
func GetFolders ¶
func GetTemplates ¶
func MarkedOrSelected ¶
func MarkedOrSelected(pm app.ProvidesMessages) ([]models.UID, error)
MarkedOrSelected returns either all marked messages if any are marked or the selected message instead
func MsgInfoFromUids ¶
func MsgInfoFromUids(store *lib.MessageStore, uids []models.UID, statusInfo func(string)) ([]*models.MessageInfo, error)
func QuoteSpace ¶
func TermCoreDirectory ¶
func UidsFromMessageInfos ¶
func UidsFromMessageInfos(msgs []*models.MessageInfo) []models.UID
UidsFromMessageInfos extracts a uid slice from a slice of MessageInfos
func ZoxideQuery ¶
Types ¶
type ChangeDirectory ¶
type ChangeDirectory struct {
Target string `opt:"directory" default:"~" complete:"CompleteTarget" desc:"Target directory."`
}
func (ChangeDirectory) Aliases ¶
func (ChangeDirectory) Aliases() []string
func (*ChangeDirectory) CompleteTarget ¶
func (*ChangeDirectory) CompleteTarget(arg string) []string
func (ChangeDirectory) Context ¶
func (ChangeDirectory) Context() CommandContext
func (ChangeDirectory) Description ¶
func (ChangeDirectory) Description() string
func (ChangeDirectory) Execute ¶
func (cd ChangeDirectory) Execute(args []string) error
type ChangeTab ¶
type ChangeTab struct {
Tab string `opt:"tab" complete:"CompleteTab" desc:"Tab name."`
}
func (*ChangeTab) CompleteTab ¶
func (ChangeTab) Context ¶
func (ChangeTab) Context() CommandContext
func (ChangeTab) Description ¶
type Choose ¶
type Choose struct {
Unused struct{} `opt:"-"`
}
func (Choose) Context ¶
func (Choose) Context() CommandContext
func (Choose) Description ¶
type Close ¶
type Close struct{}
func (Close) Context ¶
func (Close) Context() CommandContext
func (Close) Description ¶
type Command ¶
type Command interface { Description() string Context() CommandContext Aliases() []string Execute([]string) error }
func ActiveCommands ¶
func ActiveCommands() []Command
func ExpandAbbreviations ¶
Expand non-ambiguous command abbreviations.
q --> quit ar --> archive im --> import-mbox
func ResolveCommand ¶
func ResolveCommand( cmdline string, acct *config.AccountConfig, msg *models.MessageInfo, ) (string, Command, error)
type CommandContext ¶
type CommandContext uint32
func CurrentContext ¶
func CurrentContext() CommandContext
type Echo ¶
type Echo struct {
Template string `opt:"..." required:"false"`
}
func (Echo) Context ¶
func (Echo) Context() CommandContext
func (Echo) Description ¶
type Eml ¶
type Eml struct {
Path string `opt:"path" required:"false" complete:"CompletePath" desc:"EML file path."`
}
func (*Eml) CompletePath ¶
func (Eml) Context ¶
func (Eml) Context() CommandContext
func (Eml) Description ¶
type ExecCmd ¶
type ExecCmd struct {
Args []string `opt:"..."`
}
func (ExecCmd) Context ¶
func (ExecCmd) Context() CommandContext
func (ExecCmd) Description ¶
type Help ¶
type Help struct {
Topic string `opt:"topic" action:"ParseTopic" default:"aerc" complete:"CompleteTopic" desc:"Help topic."`
}
func (*Help) CompleteTopic ¶
func (Help) Context ¶
func (Help) Context() CommandContext
func (Help) Description ¶
func (*Help) ParseTopic ¶
type Menu ¶
type Menu struct { ErrExit bool `opt:"-e" desc:"Stop executing commands on the first error."` Background bool `opt:"-b" desc:"Do NOT spawn the popover dialog."` Accounts bool `opt:"-a" desc:"Feed command with account names."` Directories bool `opt:"-d" desc:"Feed command with folder names."` Command string `opt:"-c" desc:"Override [general].default-menu-cmd."` Xargs string `opt:"..." complete:"CompleteXargs" desc:"Command name."` }
func (*Menu) CompleteXargs ¶
func (Menu) Context ¶
func (Menu) Context() CommandContext
func (Menu) Description ¶
type MoveTab ¶
type MoveTab struct { Index int `opt:"index" metavar:"[+|-]<index>" action:"ParseIndex"` Relative bool }
func (MoveTab) Context ¶
func (MoveTab) Context() CommandContext
func (MoveTab) Description ¶
func (*MoveTab) ParseIndex ¶
type NewAccount ¶
type NewAccount struct {
Temp bool `opt:"-t" desc:"Create a temporary account."`
}
func (NewAccount) Aliases ¶
func (NewAccount) Aliases() []string
func (NewAccount) Context ¶
func (NewAccount) Context() CommandContext
func (NewAccount) Description ¶
func (NewAccount) Description() string
func (NewAccount) Execute ¶
func (n NewAccount) Execute(args []string) error
type NextPrevTab ¶
type NextPrevTab struct {
Offset int `opt:"n" default:"1"`
}
func (NextPrevTab) Aliases ¶
func (NextPrevTab) Aliases() []string
func (NextPrevTab) Context ¶
func (NextPrevTab) Context() CommandContext
func (NextPrevTab) Description ¶
func (NextPrevTab) Description() string
func (NextPrevTab) Execute ¶
func (np NextPrevTab) Execute(args []string) error
type NoSuchCommand ¶
type NoSuchCommand string
func (NoSuchCommand) Error ¶
func (err NoSuchCommand) Error() string
type PinTab ¶
type PinTab struct{}
func (PinTab) Context ¶
func (PinTab) Context() CommandContext
func (PinTab) Description ¶
type PrintWorkDir ¶
type PrintWorkDir struct{}
func (PrintWorkDir) Aliases ¶
func (PrintWorkDir) Aliases() []string
func (PrintWorkDir) Context ¶
func (PrintWorkDir) Context() CommandContext
func (PrintWorkDir) Description ¶
func (PrintWorkDir) Description() string
func (PrintWorkDir) Execute ¶
func (PrintWorkDir) Execute(args []string) error
type Prompt ¶
type Prompt struct { Text string `opt:"text"` Cmd []string `opt:"..." complete:"CompleteCommand" desc:"Command name."` }
func (*Prompt) CompleteCommand ¶
func (Prompt) Context ¶
func (Prompt) Context() CommandContext
func (Prompt) Description ¶
type Quit ¶
type Quit struct {
Force bool `opt:"-f" desc:"Force quit even if a task is pending."`
}
func (Quit) Context ¶
func (Quit) Context() CommandContext
func (Quit) Description ¶
type Redraw ¶
type Redraw struct{}
func (Redraw) Context ¶
func (Redraw) Context() CommandContext
func (Redraw) Description ¶
type Reload ¶
type Reload struct { Binds bool `opt:"-B" desc:"Reload binds.conf."` Conf bool `opt:"-C" desc:"Reload aerc.conf."` Style string `opt:"-s" complete:"CompleteStyle" desc:"Reload the specified styleset."` }
func (*Reload) CompleteStyle ¶
func (Reload) Context ¶
func (Reload) Context() CommandContext
func (Reload) Description ¶
type SendKeys ¶
type SendKeys struct {
Keys string `opt:"..."`
}
func (SendKeys) Context ¶
func (SendKeys) Context() CommandContext
func (SendKeys) Description ¶
type Suspend ¶
type Suspend struct{}
func (Suspend) Context ¶
func (Suspend) Context() CommandContext
func (Suspend) Description ¶
type Term ¶
type Term struct {
Cmd []string `opt:"..." required:"false"`
}
func (Term) Context ¶
func (Term) Context() CommandContext
func (Term) Description ¶
type Zoxide ¶
type Zoxide struct {
Args []string `opt:"..." required:"false" metavar:"<query>..." complete:"CompleteFolder" desc:"Target folder."`
}
func (*Zoxide) CompleteFolder ¶
func (Zoxide) Context ¶
func (Zoxide) Context() CommandContext