blob: 3170c75cc3a4562c95d2f7900563b98fd4640da1 (
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
31
32
33
34
35
36
37
38
|
package commands
import (
"errors"
"git.sr.ht/~rjarry/aerc/app"
"git.sr.ht/~sircmpwn/getopt"
)
type NewAccount struct{}
func init() {
register(NewAccount{})
}
func (NewAccount) Aliases() []string {
return []string{"new-account"}
}
func (NewAccount) Complete(aerc *app.Aerc, args []string) []string {
return nil
}
func (NewAccount) Execute(aerc *app.Aerc, args []string) error {
opts, _, err := getopt.Getopts(args, "t")
if err != nil {
return errors.New("Usage: new-account [-t]")
}
wizard := app.NewAccountWizard(aerc)
for _, opt := range opts {
if opt.Option == 't' {
wizard.ConfigureTemporaryAccount(true)
}
}
wizard.Focus(true)
aerc.NewTab(wizard, "New account")
return nil
}
|