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 []string, 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) ([]uint32, error)
- func MsgInfoFromUids(store *lib.MessageStore, uids []uint32, 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) []uint32
- func ZoxideAdd(arg string) error
- func ZoxideQuery(args []string) (string, error)
- type ChangeDirectory
- type ChangeTab
- type Choose
- type Close
- type Command
- type CommandContext
- 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 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) ([]uint32, error)
MarkedOrSelected returns either all marked messages if any are marked or the selected message instead
func MsgInfoFromUids ¶
func MsgInfoFromUids(store *lib.MessageStore, uids []uint32, statusInfo func(string)) ([]*models.MessageInfo, error)
func QuoteSpace ¶
func TermCoreDirectory ¶
func UidsFromMessageInfos ¶
func UidsFromMessageInfos(msgs []*models.MessageInfo) []uint32
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"`
}
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) Execute ¶
func (cd ChangeDirectory) Execute(args []string) error
type ChangeTab ¶
type ChangeTab struct {
Tab string `opt:"tab" complete:"CompleteTab"`
}
func (*ChangeTab) CompleteTab ¶
func (ChangeTab) Context ¶
func (ChangeTab) Context() CommandContext
type Choose ¶
type Choose struct {
Unused struct{} `opt:"-"`
}
func (Choose) Context ¶
func (Choose) Context() CommandContext
type Command ¶
type Command interface { 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 Eml ¶
type Eml struct {
Path string `opt:"path" required:"false" complete:"CompletePath"`
}
func (*Eml) CompletePath ¶
func (Eml) Context ¶
func (Eml) Context() CommandContext
type ExecCmd ¶
type ExecCmd struct {
Args []string `opt:"..."`
}
func (ExecCmd) Context ¶
func (ExecCmd) Context() CommandContext
type Help ¶
type Help struct {
Topic string `opt:"topic" action:"ParseTopic" default:"aerc" complete:"CompleteTopic"`
}
func (*Help) CompleteTopic ¶
func (Help) Context ¶
func (Help) Context() CommandContext
func (*Help) ParseTopic ¶
type Menu ¶
type Menu struct { ErrExit bool `opt:"-e"` Background bool `opt:"-b"` Accounts bool `opt:"-a"` Directories bool `opt:"-d"` Command string `opt:"-c"` Xargs string `opt:"..." complete:"CompleteXargs"` }
func (*Menu) CompleteXargs ¶
func (Menu) Context ¶
func (Menu) Context() CommandContext
type MoveTab ¶
type MoveTab struct { Index int `opt:"index" metavar:"[+|-]<index>" action:"ParseIndex"` Relative bool }
func (MoveTab) Context ¶
func (MoveTab) Context() CommandContext
func (*MoveTab) ParseIndex ¶
type NewAccount ¶
type NewAccount struct {
Temp bool `opt:"-t"`
}
func (NewAccount) Aliases ¶
func (NewAccount) Aliases() []string
func (NewAccount) Context ¶
func (NewAccount) Context() CommandContext
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) Execute ¶
func (np NextPrevTab) Execute(args []string) error
type NoSuchCommand ¶
type NoSuchCommand string
func (NoSuchCommand) Error ¶
func (err NoSuchCommand) Error() string
type PrintWorkDir ¶
type PrintWorkDir struct{}
func (PrintWorkDir) Aliases ¶
func (PrintWorkDir) Aliases() []string
func (PrintWorkDir) Context ¶
func (PrintWorkDir) Context() CommandContext
func (PrintWorkDir) Execute ¶
func (PrintWorkDir) Execute(args []string) error
type Prompt ¶
func (*Prompt) CompleteCommand ¶
func (Prompt) Context ¶
func (Prompt) Context() CommandContext
type Quit ¶
type Quit struct {
Force bool `opt:"-f"`
}
func (Quit) Context ¶
func (Quit) Context() CommandContext
type SendKeys ¶
type SendKeys struct {
Keys string `opt:"..."`
}
func (SendKeys) Context ¶
func (SendKeys) Context() CommandContext
type Suspend ¶
type Suspend struct{}
func (Suspend) Context ¶
func (Suspend) Context() CommandContext
type Term ¶
type Term struct {
Cmd []string `opt:"..." required:"false"`
}
func (Term) Context ¶
func (Term) Context() CommandContext
type Zoxide ¶
type Zoxide struct {
Args []string `opt:"..." required:"false" metavar:"<query>..." complete:"CompleteFolder"`
}
func (*Zoxide) CompleteFolder ¶
func (Zoxide) Context ¶
func (Zoxide) Context() CommandContext