Debian Codegraph @

commands/new-account.go

raw
1 package commands
2
3 import (
4 "git.sr.ht/~rjarry/aerc/app"
5 )
6
7 type NewAccount struct {
8 Temp bool `opt:"-t" desc:"Create a temporary account."`
9 }
10
11 func init() {
12 Register(NewAccount{})
13 }
14
15 func (NewAccount) Description() string {
16 return "Start the new account wizard."
17 }
18
19 func (NewAccount) Context() CommandContext {
20 return GLOBAL
21 }
22
23 func (NewAccount) Aliases() []string {
24 return []string{"new-account"}
25 }
26
27 func (n NewAccount) Execute(args []string) error {
28 wizard := app.NewAccountWizard()
29 wizard.ConfigureTemporaryAccount(n.Temp)
30 wizard.Focus(true)
31 app.NewTab(wizard, "New account")
32 return nil
33 }