diff options
author | Wagner Riffel <wgrriffel@gmail.com> | 2019-09-03 16:34:03 -0300 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-09-04 16:30:57 -1000 |
commit | 6838c23478944a9b45df1fa9a0f432ec77423987 (patch) | |
tree | df6c5eb1c3bb4af779f98dd5ec9fa2d5b7658b4f | |
parent | c6b776adbfb11ba34756a1d4f770b15c2fb3cb46 (diff) | |
download | aerc-6838c23478944a9b45df1fa9a0f432ec77423987.tar.gz |
all: purge redundant underscores
Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
45 files changed, 132 insertions, 132 deletions
diff --git a/commands/account/cf.go b/commands/account/cf.go index f318374..cbef308 100644 --- a/commands/account/cf.go +++ b/commands/account/cf.go @@ -19,15 +19,15 @@ func init() { register(ChangeFolder{}) } -func (_ ChangeFolder) Aliases() []string { +func (ChangeFolder) Aliases() []string { return []string{"cf"} } -func (_ ChangeFolder) Complete(aerc *widgets.Aerc, args []string) []string { +func (ChangeFolder) Complete(aerc *widgets.Aerc, args []string) []string { return commands.GetFolders(aerc, args) } -func (_ ChangeFolder) Execute(aerc *widgets.Aerc, args []string) error { +func (ChangeFolder) Execute(aerc *widgets.Aerc, args []string) error { if len(args) < 2 { return errors.New("Usage: cf <folder>") } diff --git a/commands/account/clear.go b/commands/account/clear.go index bb9c04e..392fdd0 100644 --- a/commands/account/clear.go +++ b/commands/account/clear.go @@ -11,15 +11,15 @@ func init() { register(Clear{}) } -func (_ Clear) Aliases() []string { +func (Clear) Aliases() []string { return []string{"clear"} } -func (_ Clear) Complete(aerc *widgets.Aerc, args []string) []string { +func (Clear) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Clear) Execute(aerc *widgets.Aerc, args []string) error { +func (Clear) Execute(aerc *widgets.Aerc, args []string) error { acct := aerc.SelectedAccount() if acct == nil { return errors.New("No account selected") diff --git a/commands/account/compose.go b/commands/account/compose.go index a4836b7..e61b593 100644 --- a/commands/account/compose.go +++ b/commands/account/compose.go @@ -15,15 +15,15 @@ func init() { register(Compose{}) } -func (_ Compose) Aliases() []string { +func (Compose) Aliases() []string { return []string{"compose"} } -func (_ Compose) Complete(aerc *widgets.Aerc, args []string) []string { +func (Compose) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Compose) Execute(aerc *widgets.Aerc, args []string) error { +func (Compose) Execute(aerc *widgets.Aerc, args []string) error { body, err := buildBody(args) if err != nil { return err diff --git a/commands/account/mkdir.go b/commands/account/mkdir.go index be9b14a..d42928e 100644 --- a/commands/account/mkdir.go +++ b/commands/account/mkdir.go @@ -16,15 +16,15 @@ func init() { register(MakeDir{}) } -func (_ MakeDir) Aliases() []string { +func (MakeDir) Aliases() []string { return []string{"mkdir"} } -func (_ MakeDir) Complete(aerc *widgets.Aerc, args []string) []string { +func (MakeDir) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ MakeDir) Execute(aerc *widgets.Aerc, args []string) error { +func (MakeDir) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 2 { return errors.New("Usage: :mkdir <name>") } diff --git a/commands/account/next-folder.go b/commands/account/next-folder.go index 537a351..6a22772 100644 --- a/commands/account/next-folder.go +++ b/commands/account/next-folder.go @@ -14,15 +14,15 @@ func init() { register(NextPrevFolder{}) } -func (_ NextPrevFolder) Aliases() []string { +func (NextPrevFolder) Aliases() []string { return []string{"next-folder", "prev-folder"} } -func (_ NextPrevFolder) Complete(aerc *widgets.Aerc, args []string) []string { +func (NextPrevFolder) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ NextPrevFolder) Execute(aerc *widgets.Aerc, args []string) error { +func (NextPrevFolder) Execute(aerc *widgets.Aerc, args []string) error { if len(args) > 2 { return nextPrevFolderUsage(args[0]) } diff --git a/commands/account/next-result.go b/commands/account/next-result.go index 24d53be..ab050af 100644 --- a/commands/account/next-result.go +++ b/commands/account/next-result.go @@ -13,15 +13,15 @@ func init() { register(NextPrevResult{}) } -func (_ NextPrevResult) Aliases() []string { +func (NextPrevResult) Aliases() []string { return []string{"next-result", "prev-result"} } -func (_ NextPrevResult) Complete(aerc *widgets.Aerc, args []string) []string { +func (NextPrevResult) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ NextPrevResult) Execute(aerc *widgets.Aerc, args []string) error { +func (NextPrevResult) Execute(aerc *widgets.Aerc, args []string) error { if len(args) > 1 { return nextPrevResultUsage(args[0]) } diff --git a/commands/account/next.go b/commands/account/next.go index 1ba4b1b..604dcd7 100644 --- a/commands/account/next.go +++ b/commands/account/next.go @@ -15,16 +15,16 @@ func init() { register(NextPrevMsg{}) } -func (_ NextPrevMsg) Aliases() []string { +func (NextPrevMsg) Aliases() []string { return []string{"next", "next-message", "prev", "prev-message"} } -func (_ NextPrevMsg) Complete(aerc *widgets.Aerc, args []string) []string { +func (NextPrevMsg) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ NextPrevMsg) Execute(aerc *widgets.Aerc, args []string) error { var err, n, pct = ParseNextPrevMessage(args) +func (NextPrevMsg) Execute(aerc *widgets.Aerc, args []string) error { if err != nil { return err } diff --git a/commands/account/search.go b/commands/account/search.go index ca51917..1d2e7a2 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -12,15 +12,15 @@ func init() { register(SearchFilter{}) } -func (_ SearchFilter) Aliases() []string { +func (SearchFilter) Aliases() []string { return []string{"search", "filter"} } -func (_ SearchFilter) Complete(aerc *widgets.Aerc, args []string) []string { +func (SearchFilter) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { +func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { acct := aerc.SelectedAccount() if acct == nil { return errors.New("No account selected") diff --git a/commands/account/select.go b/commands/account/select.go index 70e08ac..b41b234 100644 --- a/commands/account/select.go +++ b/commands/account/select.go @@ -13,15 +13,15 @@ func init() { register(SelectMessage{}) } -func (_ SelectMessage) Aliases() []string { +func (SelectMessage) Aliases() []string { return []string{"select", "select-message"} } -func (_ SelectMessage) Complete(aerc *widgets.Aerc, args []string) []string { +func (SelectMessage) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ SelectMessage) Execute(aerc *widgets.Aerc, args []string) error { +func (SelectMessage) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 2 { return errors.New("Usage: :select-message <n>") } diff --git a/commands/account/view.go b/commands/account/view.go index cec65aa..af39360 100644 --- a/commands/account/view.go +++ b/commands/account/view.go @@ -12,15 +12,15 @@ func init() { register(ViewMessage{}) } -func (_ ViewMessage) Aliases() []string { +func (ViewMessage) Aliases() []string { return []string{"view-message", "view"} } -func (_ ViewMessage) Complete(aerc *widgets.Aerc, args []string) []string { +func (ViewMessage) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ ViewMessage) Execute(aerc *widgets.Aerc, args []string) error { +func (ViewMessage) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 1 { return errors.New("Usage: view-message") } diff --git a/commands/cd.go b/commands/cd.go index 3630cae..1d033e4 100644 --- a/commands/cd.go +++ b/commands/cd.go @@ -19,11 +19,11 @@ func init() { register(ChangeDirectory{}) } -func (_ ChangeDirectory) Aliases() []string { +func (ChangeDirectory) Aliases() []string { return []string{"cd"} } -func (_ ChangeDirectory) Complete(aerc *widgets.Aerc, args []string) []string { +func (ChangeDirectory) Complete(aerc *widgets.Aerc, args []string) []string { path := "" if len(args) >= 1 { path = args[0] @@ -42,7 +42,7 @@ func (_ ChangeDirectory) Complete(aerc *widgets.Aerc, args []string) []string { return dirs } -func (_ ChangeDirectory) Execute(aerc *widgets.Aerc, args []string) error { +func (ChangeDirectory) Execute(aerc *widgets.Aerc, args []string) error { if len(args) < 1 || len(args) > 2 { return errors.New("Usage: cd [directory]") } diff --git a/commands/compose/abort.go b/commands/compose/abort.go index 4c121d7..74d0395 100644 --- a/commands/compose/abort.go +++ b/commands/compose/abort.go @@ -12,15 +12,15 @@ func init() { register(Abort{}) } -func (_ Abort) Aliases() []string { +func (Abort) Aliases() []string { return []string{"abort"} } -func (_ Abort) Complete(aerc *widgets.Aerc, args []string) []string { +func (Abort) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Abort) Execute(aerc *widgets.Aerc, args []string) error { +func (Abort) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 1 { return errors.New("Usage: abort") } diff --git a/commands/compose/attach.go b/commands/compose/attach.go index 7501a33..969d12e 100644 --- a/commands/compose/attach.go +++ b/commands/compose/attach.go @@ -17,11 +17,11 @@ func init() { register(Attach{}) } -func (_ Attach) Aliases() []string { +func (Attach) Aliases() []string { return []string{"attach"} } -func (_ Attach) Complete(aerc *widgets.Aerc, args []string) []string { +func (Attach) Complete(aerc *widgets.Aerc, args []string) []string { path := "" if len(args) >= 1 { path = args[0] @@ -30,7 +30,7 @@ func (_ Attach) Complete(aerc *widgets.Aerc, args []string) []string { return commands.CompletePath(path) } -func (_ Attach) Execute(aerc *widgets.Aerc, args []string) error { +func (Attach) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 2 { return fmt.Errorf("Usage: :attach <path>") } diff --git a/commands/compose/cc-bcc.go b/commands/compose/cc-bcc.go index db5f5b6..ce62242 100644 --- a/commands/compose/cc-bcc.go +++ b/commands/compose/cc-bcc.go @@ -12,15 +12,15 @@ func init() { register(CC{}) } -func (_ CC) Aliases() []string { +func (CC) Aliases() []string { return []string{"cc", "bcc"} } -func (_ CC) Complete(aerc *widgets.Aerc, args []string) []string { +func (CC) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ CC) Execute(aerc *widgets.Aerc, args []string) error { +func (CC) Execute(aerc *widgets.Aerc, args []string) error { var addrs string if len(args) > 1 { addrs = strings.Join(args[1:], " ") diff --git a/commands/compose/detach.go b/commands/compose/detach.go index e700ab6..dc70ff9 100644 --- a/commands/compose/detach.go +++ b/commands/compose/detach.go @@ -14,17 +14,17 @@ func init() { register(Detach{}) } -func (_ Detach) Aliases() []string { +func (Detach) Aliases() []string { return []string{"detach"} } -func (_ Detach) Complete(aerc *widgets.Aerc, args []string) []string { +func (Detach) Complete(aerc *widgets.Aerc, args []string) []string { composer, _ := aerc.SelectedTab().(*widgets.Composer) return composer.GetAttachments() } -func (_ Detach) Execute(aerc *widgets.Aerc, args []string) error { +func (Detach) Execute(aerc *widgets.Aerc, args []string) error { var path string composer, _ := aerc.SelectedTab().(*widgets.Composer) diff --git a/commands/compose/edit.go b/commands/compose/edit.go index e888350..e788022 100644 --- a/commands/compose/edit.go +++ b/commands/compose/edit.go @@ -12,15 +12,15 @@ func init() { register(Edit{}) } -func (_ Edit) Aliases() []string { +func (Edit) Aliases() []string { return []string{"edit"} } -func (_ Edit) Complete(aerc *widgets.Aerc, args []string) []string { +func (Edit) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Edit) Execute(aerc *widgets.Aerc, args []string) error { +func (Edit) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 1 { return errors.New("Usage: edit") } diff --git a/commands/compose/next-field.go b/commands/compose/next-field.go index 3496dfd..43ae644 100644 --- a/commands/compose/next-field.go +++ b/commands/compose/next-field.go @@ -13,15 +13,15 @@ func init() { register(NextPrevField{}) } -func (_ NextPrevField) Aliases() []string { +func (NextPrevField) Aliases() []string { return []string{"next-field", "prev-field"} } -func (_ NextPrevField) Complete(aerc *widgets.Aerc, args []string) []string { +func (NextPrevField) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ NextPrevField) Execute(aerc *widgets.Aerc, args []string) error { +func (NextPrevField) Execute(aerc *widgets.Aerc, args []string) error { if len(args) > 2 { return nextPrevFieldUsage(args[0]) } diff --git a/commands/compose/send.go b/commands/compose/send.go index 202d8c6..5a12428 100644 --- a/commands/compose/send.go +++ b/commands/compose/send.go @@ -28,15 +28,15 @@ func init() { register(Send{}) } -func (_ Send) Aliases() []string { +func (Send) Aliases() []string { return []string{"send"} } -func (_ Send) Complete(aerc *widgets.Aerc, args []string) []string { +func (Send) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Send) Execute(aerc *widgets.Aerc, args []string) error { +func (Send) Execute(aerc *widgets.Aerc, args []string) error { if len(args) > 1 { return errors.New("Usage: send") } diff --git a/commands/ct.go b/commands/ct.go index 4e66331..f84e8a9 100644 --- a/commands/ct.go +++ b/commands/ct.go @@ -15,11 +15,11 @@ func init() { register(ChangeTab{}) } -func (_ ChangeTab) Aliases() []string { +func (ChangeTab) Aliases() []string { return []string{"ct", "change-tab"} } -func (_ ChangeTab) Complete(aerc *widgets.Aerc, args []string) []string { +func (ChangeTab) Complete(aerc *widgets.Aerc, args []string) []string { if len(args) == 0 { return aerc.TabNames() } @@ -32,7 +32,7 @@ func (_ ChangeTab) Complete(aerc *widgets.Aerc, args []string) []string { return out } -func (_ ChangeTab) Execute(aerc *widgets.Aerc, args []string) error { +func (ChangeTab) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 2 { return errors.New(fmt.Sprintf("Usage: %s <tab>", args[0])) } diff --git a/commands/exec.go b/commands/exec.go index 27edf5d..f615b71 100644 --- a/commands/exec.go +++ b/commands/exec.go @@ -17,15 +17,15 @@ func init() { register(ExecCmd{}) } -func (_ ExecCmd) Aliases() []string { +func (ExecCmd) Aliases() []string { return []string{"exec"} } -func (_ ExecCmd) Complete(aerc *widgets.Aerc, args []string) []string { +func (ExecCmd) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ ExecCmd) Execute(aerc *widgets.Aerc, args []string) error { +func (ExecCmd) Execute(aerc *widgets.Aerc, args []string) error { if len(args) < 2 { return errors.New("Usage: exec [cmd...]") } diff --git a/commands/help.go b/commands/help.go index c4ed4ff..b27c2f0 100644 --- a/commands/help.go +++ b/commands/help.go @@ -12,15 +12,15 @@ func init() { register(Help{}) } -func (_ Help) Aliases() []string { +func (Help) Aliases() []string { return []string{"help"} } -func (_ Help) Complete(aerc *widgets.Aerc, args []string) []string { +func (Help) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Help) Execute(aerc *widgets.Aerc, args []string) error { +func (Help) Execute(aerc *widgets.Aerc, args []string) error { page := "aerc" if len(args) == 2 { page = "aerc-" + args[1] diff --git a/commands/msg/archive.go b/commands/msg/archive.go index 63d6de0..6bf231d 100644 --- a/commands/msg/archive.go +++ b/commands/msg/archive.go @@ -24,15 +24,15 @@ func init() { register(Archive{}) } -func (_ Archive) Aliases() []string { +func (Archive) Aliases() []string { return []string{"archive"} } -func (_ Archive) Complete(aerc *widgets.Aerc, args []string) []string { +func (Archive) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Archive) Execute(aerc *widgets.Aerc, args []string) error { +func (Archive) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 2 { return errors.New("Usage: archive <flat|year|month>") } diff --git a/commands/msg/copy.go b/commands/msg/copy.go index 8056e38..398beae 100644 --- a/commands/msg/copy.go +++ b/commands/msg/copy.go @@ -17,15 +17,15 @@ func init() { register(Copy{}) } -func (_ Copy) Aliases() []string { +func (Copy) Aliases() []string { return []string{"cp", "copy"} } -func (_ Copy) Complete(aerc *widgets.Aerc, args []string) []string { +func (Copy) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Copy) Execute(aerc *widgets.Aerc, args []string) error { +func (Copy) Execute(aerc *widgets.Aerc, args []string) error { opts, optind, err := getopt.Getopts(args, "p") if err != nil { return err diff --git a/commands/msg/delete.go b/commands/msg/delete.go index 06cef9c..677ea63 100644 --- a/commands/msg/delete.go +++ b/commands/msg/delete.go @@ -16,15 +16,15 @@ func init() { register(Delete{}) } -func (_ Delete) Aliases() []string { +func (Delete) Aliases() []string { return []string{"delete", "delete-message"} } -func (_ Delete) Complete(aerc *widgets.Aerc, args []string) []string { +func (Delete) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Delete) Execute(aerc *widgets.Aerc, args []string) error { +func (Delete) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 1 { return errors.New("Usage: :delete") } diff --git a/commands/msg/forward.go b/commands/msg/forward.go index 7f23a0a..b925a49 100644 --- a/commands/msg/forward.go +++ b/commands/msg/forward.go @@ -23,15 +23,15 @@ func init() { register(forward{}) } -func (_ forward) Aliases() []string { +func (forward) Aliases() []string { return []string{"forward"} } -func (_ forward) Complete(aerc *widgets.Aerc, args []string) []string { +func (forward) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ forward) Execute(aerc *widgets.Aerc, args []string) error { +func (forward) Execute(aerc *widgets.Aerc, args []string) error { opts, optind, err := getopt.Getopts(args, "A") if err != nil { return err diff --git a/commands/msg/move.go b/commands/msg/move.go index b7d52ff..2f8c61e 100644 --- a/commands/msg/move.go +++ b/commands/msg/move.go @@ -18,15 +18,15 @@ func init() { register(Move{}) } -func (_ Move) Aliases() []string { +func (Move) Aliases() []string { return []string{"mv", "move"} } -func (_ Move) Complete(aerc *widgets.Aerc, args []string) []string { +func (Move) Complete(aerc *widgets.Aerc, args []string) []string { return commands.GetFolders(aerc, args) } -func (_ Move) Execute(aerc *widgets.Aerc, args []string) error { +func (Move) Execute(aerc *widgets.Aerc, args []string) error { opts, optind, err := getopt.Getopts(args, "p") if err != nil { return err diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go index 77e5d96..2faa5de 100644 --- a/commands/msg/pipe.go +++ b/commands/msg/pipe.go @@ -23,15 +23,15 @@ func init() { register(Pipe{}) } -func (_ Pipe) Aliases() []string { +func (Pipe) Aliases() []string { return []string{"pipe"} } -func (_ Pipe) Complete(aerc *widgets.Aerc, args []string) []string { +func (Pipe) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Pipe) Execute(aerc *widgets.Aerc, args []string) error { +func (Pipe) Execute(aerc *widgets.Aerc, args []string) error { var ( background bool pipeFull bool diff --git a/commands/msg/read.go b/commands/msg/read.go index 3497ef1..0da664b 100644 --- a/commands/msg/read.go +++ b/commands/msg/read.go @@ -19,15 +19,15 @@ func init() { register(Read{}) } -func (_ Read) Aliases() []string { +func (Read) Aliases() []string { return []string{"read", "unread"} } -func (_ Read) Complete(aerc *widgets.Aerc, args []string) []string { +func (Read) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Read) Execute(aerc *widgets.Aerc, args []string) error { +func (Read) Execute(aerc *widgets.Aerc, args []string) error { opts, optind, err := getopt.Getopts(args, "t") if err != nil { return err diff --git a/commands/msg/reply.go b/commands/msg/reply.go index bab16e1..34d03d5 100644 --- a/commands/msg/reply.go +++ b/commands/msg/reply.go @@ -23,15 +23,15 @@ func init() { register(reply{}) } -func (_ reply) Aliases() []string { +func (reply) Aliases() []string { return []string{"reply"} } -func (_ reply) Complete(aerc *widgets.Aerc, args []string) []string { +func (reply) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ reply) Execute(aerc *widgets.Aerc, args []string) error { +func (reply) Execute(aerc *widgets.Aerc, args []string) error { opts, optind, err := getopt.Getopts(args, "aq") if err != nil { return err diff --git a/commands/msgview/close.go b/commands/msgview/close.go index 6a7eb0a..9966735 100644 --- a/commands/msgview/close.go +++ b/commands/msgview/close.go @@ -12,15 +12,15 @@ func init() { register(Close{}) } -func (_ Close) Aliases() []string { +func (Close) Aliases() []string { return []string{"close"} } -func (_ Close) Complete(aerc *widgets.Aerc, args []string) []string { +func (Close) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Close) Execute(aerc *widgets.Aerc, args []string) error { +func (Close) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 1 { return errors.New("Usage: close") } diff --git a/commands/msgview/next-part.go b/commands/msgview/next-part.go index 8f25e02..c9423cc 100644 --- a/commands/msgview/next-part.go +++ b/commands/msgview/next-part.go @@ -14,15 +14,15 @@ func init() { register(NextPrevPart{}) } -func (_ NextPrevPart) Aliases() []string { +func (NextPrevPart) Aliases() []string { return []string{"next-part", "prev-part"} } -func (_ NextPrevPart) Complete(aerc *widgets.Aerc, args []string) []string { +func (NextPrevPart) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ NextPrevPart) Execute(aerc *widgets.Aerc, args []string) error { +func (NextPrevPart) Execute(aerc *widgets.Aerc, args []string) error { if len(args) > 2 { return nextPrevPartUsage(args[0]) } diff --git a/commands/msgview/next.go b/commands/msgview/next.go index 647aafb..3943ac9 100644 --- a/commands/msgview/next.go +++ b/commands/msgview/next.go @@ -11,16 +11,16 @@ func init() { register(NextPrevMsg{}) } -func (_ NextPrevMsg) Aliases() []string { +func (NextPrevMsg) Aliases() []string { return []string{"next", "next-message", "prev", "prev-message"} } -func (_ NextPrevMsg) Complete(aerc *widgets.Aerc, args []string) []string { +func (NextPrevMsg) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ NextPrevMsg) Execute(aerc *widgets.Aerc, args []string) error { err, n, pct := account.ParseNextPrevMessage(args) +func (NextPrevMsg) Execute(aerc *widgets.Aerc, args []string) error { if err != nil { return err } diff --git a/commands/msgview/open.go b/commands/msgview/open.go index f4a0931..ab023a1 100644 --- a/commands/msgview/open.go +++ b/commands/msgview/open.go @@ -20,15 +20,15 @@ func init() { register(Open{}) } -func (_ Open) Aliases() []string { +func (Open) Aliases() []string { return []string{"open"} } -func (_ Open) Complete(aerc *widgets.Aerc, args []string) []string { +func (Open) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Open) Execute(aerc *widgets.Aerc, args []string) error { +func (Open) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 1 { return errors.New("Usage: open") } diff --git a/commands/msgview/save.go b/commands/msgview/save.go index 75ba56f..3b38ec7 100644 --- a/commands/msgview/save.go +++ b/commands/msgview/save.go @@ -22,15 +22,15 @@ func init() { register(Save{}) } -func (_ Save) Aliases() []string { +func (Save) Aliases() []string { return []string{"save"} } -func (_ Save) Complete(aerc *widgets.Aerc, args []string) []string { +func (Save) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Save) Execute(aerc *widgets.Aerc, args []string) error { +func (Save) Execute(aerc *widgets.Aerc, args []string) error { opts, optind, err := getopt.Getopts(args, "p") if err != nil { return err diff --git a/commands/msgview/toggle-headers.go b/commands/msgview/toggle-headers.go index d9d7eba..f13e27d 100644 --- a/commands/msgview/toggle-headers.go +++ b/commands/msgview/toggle-headers.go @@ -13,15 +13,15 @@ func init() { register(ToggleHeaders{}) } -func (_ ToggleHeaders) Aliases() []string { +func (ToggleHeaders) Aliases() []string { return []string{"toggle-headers"} } -func (_ ToggleHeaders) Complete(aerc *widgets.Aerc, args []string) []string { +func (ToggleHeaders) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ ToggleHeaders) Execute(aerc *widgets.Aerc, args []string) error { +func (ToggleHeaders) Execute(aerc *widgets.Aerc, args []string) error { if len(args) > 1 { return toggleHeadersUsage(args[0]) } diff --git a/commands/new-account.go b/commands/new-account.go index 8d2fef5..ff585c0 100644 --- a/commands/new-account.go +++ b/commands/new-account.go @@ -13,15 +13,15 @@ func init() { register(NewAccount{}) } -func (_ NewAccount) Aliases() []string { +func (NewAccount) Aliases() []string { return []string{"new-account"} } -func (_ NewAccount) Complete(aerc *widgets.Aerc, args []string) []string { +func (NewAccount) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ NewAccount) Execute(aerc *widgets.Aerc, args []string) error { +func (NewAccount) Execute(aerc *widgets.Aerc, args []string) error { opts, _, err := getopt.Getopts(args, "t") if err != nil { return errors.New("Usage: new-account [-t]") diff --git a/commands/next-tab.go b/commands/next-tab.go index aa6e1dc..5af8692 100644 --- a/commands/next-tab.go +++ b/commands/next-tab.go @@ -14,15 +14,15 @@ func init() { register(NextPrevTab{}) } -func (_ NextPrevTab) Aliases() []string { +func (NextPrevTab) Aliases() []string { return []string{"next-tab", "prev-tab"} } -func (_ NextPrevTab) Complete(aerc *widgets.Aerc, args []string) []string { +func (NextPrevTab) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ NextPrevTab) Execute(aerc *widgets.Aerc, args []string) error { +func (NextPrevTab) Execute(aerc *widgets.Aerc, args []string) error { if len(args) > 2 { return nextPrevTabUsage(args[0]) } diff --git a/commands/prompt.go b/commands/prompt.go index 3734881..fe152c8 100644 --- a/commands/prompt.go +++ b/commands/prompt.go @@ -13,15 +13,15 @@ func init() { register(Prompt{}) } -func (_ Prompt) Aliases() []string { +func (Prompt) Aliases() []string { return []string{"prompt"} } -func (_ Prompt) Complete(aerc *widgets.Aerc, args []string) []string { +func (Prompt) Complete(aerc *widgets.Aerc, args []string) []string { return nil // TODO: add completions } -func (_ Prompt) Execute(aerc *widgets.Aerc, args []string) error { +func (Prompt) Execute(aerc *widgets.Aerc, args []string) error { if len(args) < 3 { return errors.New(fmt.Sprintf("Usage: %s <prompt> <cmd>", args[0])) } diff --git a/commands/pwd.go b/commands/pwd.go index 4903c29..d3f0e0c 100644 --- a/commands/pwd.go +++ b/commands/pwd.go @@ -14,15 +14,15 @@ func init() { register(PrintWorkDir{}) } -func (_ PrintWorkDir) Aliases() []string { +func (PrintWorkDir) Aliases() []string { return []string{"pwd"} } -func (_ PrintWorkDir) Complete(aerc *widgets.Aerc, args []string) []string { +func (PrintWorkDir) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ PrintWorkDir) Execute(aerc *widgets.Aerc, args []string) error { +func (PrintWorkDir) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 1 { return errors.New("Usage: pwd") } diff --git a/commands/quit.go b/commands/quit.go index 535ee61..63bc94a 100644 --- a/commands/quit.go +++ b/commands/quit.go @@ -12,11 +12,11 @@ func init() { register(Quit{}) } -func (_ Quit) Aliases() []string { +func (Quit) Aliases() []string { return []string{"quit", "exit"} } -func (_ Quit) Complete(aerc *widgets.Aerc, args []string) []string { +func (Quit) Complete(aerc *widgets.Aerc, args []string) []string { return nil } @@ -26,7 +26,7 @@ func (err ErrorExit) Error() string { return "exit" } -func (_ Quit) Execute(aerc *widgets.Aerc, args []string) error { +func (Quit) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 1 { return errors.New("Usage: quit") } diff --git a/commands/set.go b/commands/set.go index f5366ff..1d20f06 100644 --- a/commands/set.go +++ b/commands/set.go @@ -19,12 +19,12 @@ func init() { register(Set{}) } -func (_ Set) Aliases() []string { +func (Set) Aliases() []string { return []string{"set"} } -func (_ Set) Complete(aerc *widgets.Aerc, args []string) []string { +func (Set) Complete(aerc *widgets.Aerc, args []string) []string { return nil } @@ -64,6 +64,6 @@ func SetCore(aerc *widgets.Aerc, args []string) error { return nil } -func (_ Set) Execute(aerc *widgets.Aerc, args []string) error { +func (Set) Execute(aerc *widgets.Aerc, args []string) error { return SetCore(aerc, args) } diff --git a/commands/term.go b/commands/term.go index 8575019..459f405 100644 --- a/commands/term.go +++ b/commands/term.go @@ -16,11 +16,11 @@ func init() { register(Term{}) } -func (_ Term) Aliases() []string { +func (Term) Aliases() []string { return []string{"terminal", "term"} } -func (_ Term) Complete(aerc *widgets.Aerc, args []string) []string { +func (Term) Complete(aerc *widgets.Aerc, args []string) []string { return nil } @@ -55,6 +55,6 @@ func TermCore(aerc *widgets.Aerc, args []string) error { return nil } -func (_ Term) Execute(aerc *widgets.Aerc, args []string) error { +func (Term) Execute(aerc *widgets.Aerc, args []string) error { return TermCore(aerc, args) } diff --git a/commands/terminal/close.go b/commands/terminal/close.go index 8256e67..aca0166 100644 --- a/commands/terminal/close.go +++ b/commands/terminal/close.go @@ -12,15 +12,15 @@ func init() { register(Close{}) } -func (_ Close) Aliases() []string { +func (Close) Aliases() []string { return []string{"close"} } -func (_ Close) Complete(aerc *widgets.Aerc, args []string) []string { +func (Close) Complete(aerc *widgets.Aerc, args []string) []string { return nil } -func (_ Close) Execute(aerc *widgets.Aerc, args []string) error { +func (Close) Execute(aerc *widgets.Aerc, args []string) error { if len(args) != 1 { return errors.New("Usage: close") } diff --git a/widgets/aerc.go b/widgets/aerc.go index 345f3ea..87009cd 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -301,7 +301,7 @@ func (aerc *Aerc) SelectTab(name string) bool { } func (aerc *Aerc) SelectTabIndex(index int) bool { - for i, _ := range aerc.tabs.Tabs { + for i := range aerc.tabs.Tabs { if i == index { aerc.tabs.Select(i) return true diff --git a/widgets/exline.go b/widgets/exline.go index 8ec69d6..1482f0e 100644 --- a/widgets/exline.go +++ b/widgets/exline.go @@ -92,7 +92,7 @@ type nullHistory struct { input *ui.TextInput } -func (_ *nullHistory) Add(string) {} +func (*nullHistory) Add(string) {} func (h *nullHistory) Next() string { return h.input.String() @@ -102,4 +102,4 @@ func (h *nullHistory) Prev() string { return h.input.String() } -func (_ *nullHistory) Reset() {} +func (*nullHistory) Reset() {} |