Implement basic tab completion support

Tab completion currently only works on commands. Contextual completion
will be added in the future.
This commit is contained in:
Gregory Mullen 2019-06-27 10:33:11 -07:00 committed by Drew DeVault
parent 177651bdda
commit 2a0961701c
47 changed files with 598 additions and 154 deletions
commands/msg

View file

@ -11,12 +11,21 @@ import (
"git.sr.ht/~sircmpwn/aerc/worker/types"
)
type Copy struct{}
func init() {
register("cp", Copy)
register("copy", Copy)
register(Copy{})
}
func Copy(aerc *widgets.Aerc, args []string) error {
func (_ Copy) Aliases() []string {
return []string{"copy"}
}
func (_ Copy) Complete(aerc *widgets.Aerc, args []string) []string {
return nil
}
func (_ Copy) Execute(aerc *widgets.Aerc, args []string) error {
opts, optind, err := getopt.Getopts(args, "p")
if err != nil {
return err