Introduce :new-account -t
Adding the [-t] temporary flag to the new-account command - when using -t a newly created account will not be stored into the accounts.conf Issue #134
This commit is contained in:
parent
7446a17830
commit
0771eaf24c
2 changed files with 32 additions and 16 deletions
commands
|
@ -4,6 +4,7 @@ import (
|
|||
"errors"
|
||||
|
||||
"git.sr.ht/~sircmpwn/aerc/widgets"
|
||||
"git.sr.ht/~sircmpwn/getopt"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -11,10 +12,17 @@ func init() {
|
|||
}
|
||||
|
||||
func CommandNewAccount(aerc *widgets.Aerc, args []string) error {
|
||||
if len(args) != 1 {
|
||||
return errors.New("Usage: new-account")
|
||||
opts, _, err := getopt.Getopts(args[1:], "t")
|
||||
if err != nil {
|
||||
return errors.New("Usage: new-account [-t]")
|
||||
}
|
||||
wizard := widgets.NewAccountWizard(aerc.Config(), aerc)
|
||||
for _, opt := range opts {
|
||||
switch opt.Option {
|
||||
case 't':
|
||||
wizard.ConfigureTemporaryAccount(true)
|
||||
}
|
||||
}
|
||||
aerc.NewTab(wizard, "New account")
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue