~sircmpwn/aerc

feacca3c5caffb11be1f5f7cbfef01400b5bc944 — Wagner Riffel 1 year, 4 months ago 6838c23
all: use fmt.Errorf for fomartting errors

Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
M commands/account/next-folder.go => commands/account/next-folder.go +1 -1
@@ 49,5 49,5 @@ func (NextPrevFolder) Execute(aerc *widgets.Aerc, args []string) error {
}

func nextPrevFolderUsage(cmd string) error {
	return errors.New(fmt.Sprintf("Usage: %s [n]", cmd))
	return fmt.Errorf("Usage: %s [n]", cmd)
}

M commands/account/next-result.go => commands/account/next-result.go +1 -1
@@ 46,5 46,5 @@ func (NextPrevResult) Execute(aerc *widgets.Aerc, args []string) error {
}

func nextPrevResultUsage(cmd string) error {
	return errors.New(fmt.Sprintf("Usage: %s [<n>[%%]]", cmd))
	return fmt.Errorf("Usage: %s [<n>[%%]]", cmd)
}

M commands/account/next.go => commands/account/next.go +1 -1
@@ 78,5 78,5 @@ func ExecuteNextPrevMessage(args []string, acct *widgets.AccountView, pct bool, 
}

func nextPrevMessageUsage(cmd string) error {
	return errors.New(fmt.Sprintf("Usage: %s [<n>[%%]]", cmd))
	return fmt.Errorf("Usage: %s [<n>[%%]]", cmd)
}

M commands/compose/next-field.go => commands/compose/next-field.go +1 -2
@@ 1,7 1,6 @@
package compose

import (
	"errors"
	"fmt"

	"git.sr.ht/~sircmpwn/aerc/widgets"


@@ 35,5 34,5 @@ func (NextPrevField) Execute(aerc *widgets.Aerc, args []string) error {
}

func nextPrevFieldUsage(cmd string) error {
	return errors.New(fmt.Sprintf("Usage: %s", cmd))
	return fmt.Errorf("Usage: %s", cmd)
}

M commands/ct.go => commands/ct.go +1 -1
@@ 34,7 34,7 @@ func (ChangeTab) Complete(aerc *widgets.Aerc, args []string) []string {

func (ChangeTab) Execute(aerc *widgets.Aerc, args []string) error {
	if len(args) != 2 {
		return errors.New(fmt.Sprintf("Usage: %s <tab>", args[0]))
		return fmt.Errorf("Usage: %s <tab>", args[0])
	}
	if args[1] == "-" {
		ok := aerc.SelectPreviousTab()

M commands/msgview/next-part.go => commands/msgview/next-part.go +1 -2
@@ 1,7 1,6 @@
package msgview

import (
	"errors"
	"fmt"
	"strconv"



@@ 48,5 47,5 @@ func (NextPrevPart) Execute(aerc *widgets.Aerc, args []string) error {
}

func nextPrevPartUsage(cmd string) error {
	return errors.New(fmt.Sprintf("Usage: %s [n]", cmd))
	return fmt.Errorf("Usage: %s [n]", cmd)
}

M commands/msgview/toggle-headers.go => commands/msgview/toggle-headers.go +1 -2
@@ 1,7 1,6 @@
package msgview

import (
	"errors"
	"fmt"

	"git.sr.ht/~sircmpwn/aerc/widgets"


@@ 31,5 30,5 @@ func (ToggleHeaders) Execute(aerc *widgets.Aerc, args []string) error {
}

func toggleHeadersUsage(cmd string) error {
	return errors.New(fmt.Sprintf("Usage: %s", cmd))
	return fmt.Errorf("Usage: %s", cmd)
}

M commands/next-tab.go => commands/next-tab.go +1 -2
@@ 1,7 1,6 @@
package commands

import (
	"errors"
	"fmt"
	"strconv"



@@ 47,5 46,5 @@ func (NextPrevTab) Execute(aerc *widgets.Aerc, args []string) error {
}

func nextPrevTabUsage(cmd string) error {
	return errors.New(fmt.Sprintf("Usage: %s [n]", cmd))
	return fmt.Errorf("Usage: %s [n]", cmd)
}

M commands/prompt.go => commands/prompt.go +1 -2
@@ 1,7 1,6 @@
package commands

import (
	"errors"
	"fmt"

	"git.sr.ht/~sircmpwn/aerc/widgets"


@@ 23,7 22,7 @@ func (Prompt) Complete(aerc *widgets.Aerc, args []string) []string {

func (Prompt) Execute(aerc *widgets.Aerc, args []string) error {
	if len(args) < 3 {
		return errors.New(fmt.Sprintf("Usage: %s <prompt> <cmd>", args[0]))
		return fmt.Errorf("Usage: %s <prompt> <cmd>", args[0])
	}

	prompt := args[1]

M config/bindings.go => config/bindings.go +1 -1
@@ 122,7 122,7 @@ func ParseKeyStrokes(keystrokes string) ([]KeyStroke, error) {
			if key, ok := keyNames[strings.ToLower(name)]; ok {
				strokes = append(strokes, key)
			} else {
				return nil, errors.New(fmt.Sprintf("Unknown key '%s'", name))
				return nil, fmt.Errorf("Unknown key '%s'", name)
			}
		case '>':
			return nil, errors.New("Found '>' without '<'")