diff options
Diffstat (limited to 'commands/account')
-rw-r--r-- | commands/account/clear.go | 3 | ||||
-rw-r--r-- | commands/account/import-mbox.go | 3 | ||||
-rw-r--r-- | commands/account/recover.go | 10 | ||||
-rw-r--r-- | commands/account/rmdir.go | 3 |
4 files changed, 8 insertions, 11 deletions
diff --git a/commands/account/clear.go b/commands/account/clear.go index af7da324..6d1e7b0a 100644 --- a/commands/account/clear.go +++ b/commands/account/clear.go @@ -39,8 +39,7 @@ func (Clear) Execute(aerc *widgets.Aerc, args []string) error { } for _, opt := range opts { - switch opt.Option { - case 's': + if opt.Option == 's' { clearSelected = true } } diff --git a/commands/account/import-mbox.go b/commands/account/import-mbox.go index 9f0e7004..5a8a2ee6 100644 --- a/commands/account/import-mbox.go +++ b/commands/account/import-mbox.go @@ -135,8 +135,7 @@ func (ImportMbox) Execute(aerc *widgets.Aerc, args []string) error { func(option string, err error) { aerc.CloseDialog() aerc.Invalidate() - switch option { - case "Yes": + if option == "Yes" { go importFolder() } }, diff --git a/commands/account/recover.go b/commands/account/recover.go index 165e88e8..7a1100e4 100644 --- a/commands/account/recover.go +++ b/commands/account/recover.go @@ -36,9 +36,10 @@ func (Recover) Complete(aerc *widgets.Aerc, args []string) []string { if len(args) == 0 { return files } - if args[0] == "-" { + switch args[0] { + case "-": return []string{"-f"} - } else if args[0] == "-f" { + case "-f": if len(args) == 1 { for i, file := range files { files[i] = args[0] + " " + file @@ -49,7 +50,7 @@ func (Recover) Complete(aerc *widgets.Aerc, args []string) []string { return commands.FilterList(files, args[1], args[0]+" ", aerc.SelectedAccountUiConfig().FuzzyComplete) } - } else { + default: // only accepts one file to recover return commands.FilterList(files, args[0], "", aerc.SelectedAccountUiConfig().FuzzyComplete) } @@ -68,8 +69,7 @@ func (Recover) Execute(aerc *widgets.Aerc, args []string) error { return err } for _, opt := range opts { - switch opt.Option { - case 'f': + if opt.Option == 'f' { force = true } } diff --git a/commands/account/rmdir.go b/commands/account/rmdir.go index be493777..e45a7a7a 100644 --- a/commands/account/rmdir.go +++ b/commands/account/rmdir.go @@ -37,8 +37,7 @@ func (RemoveDir) Execute(aerc *widgets.Aerc, args []string) error { return err } for _, opt := range opts { - switch opt.Option { - case 'f': + if opt.Option == 'f' { force = true } } |