aboutsummaryrefslogblamecommitdiffstats
path: root/commands/msgview/close.go
blob: 428dc51f62c8fcf6e05b0acf92210a749c0c806a (plain) (tree)
1
2
3
4
5
6




                
                                    







                         
                                 


                                
                                                               


                  
                                                           


                                                 
                                                               
                                

                  
package msgview

import (
	"errors"

	"git.sr.ht/~rjarry/aerc/app"
)

type Close struct{}

func init() {
	register(Close{})
}

func (Close) Aliases() []string {
	return []string{"close"}
}

func (Close) Complete(aerc *app.Aerc, args []string) []string {
	return nil
}

func (Close) Execute(aerc *app.Aerc, args []string) error {
	if len(args) != 1 {
		return errors.New("Usage: close")
	}
	mv, _ := aerc.SelectedTabContent().(*app.MessageViewer)
	aerc.RemoveTab(mv, true)
	return nil
}