aboutsummaryrefslogtreecommitdiffstats
path: root/commands/patch/term.go
blob: f9f79be1bc49bc3afb34b43a8d2d2db6da5a7681 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package patch

import (
	"git.sr.ht/~rjarry/aerc/commands"
	"git.sr.ht/~rjarry/aerc/lib/pama"
)

type Term struct {
	Cmd []string `opt:"..." required:"false"`
}

func init() {
	register(Term{})
}

func (Term) Context() commands.CommandContext {
	return commands.GLOBAL
}

func (Term) Aliases() []string {
	return []string{"term"}
}

func (t Term) Execute(_ []string) error {
	p, err := pama.New().CurrentProject()
	if err != nil {
		return err
	}
	return commands.TermCoreDirectory(t.Cmd, p.Root)
}