From 0a521241025d22d060b62cabe145bd9768b5da16 Mon Sep 17 00:00:00 2001 From: Daniel Bridges Date: Sat, 3 Aug 2019 21:09:13 -0700 Subject: Allow cc/bcc command to receive no arguments --- commands/compose/cc-bcc.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'commands') diff --git a/commands/compose/cc-bcc.go b/commands/compose/cc-bcc.go index 864bb8e..db5f5b6 100644 --- a/commands/compose/cc-bcc.go +++ b/commands/compose/cc-bcc.go @@ -1,7 +1,6 @@ package compose import ( - "fmt" "strings" "git.sr.ht/~sircmpwn/aerc/widgets" @@ -22,10 +21,10 @@ func (_ CC) Complete(aerc *widgets.Aerc, args []string) []string { } func (_ CC) Execute(aerc *widgets.Aerc, args []string) error { - if len(args) < 2 { - return fmt.Errorf("Usage: %s ", args[0]) + var addrs string + if len(args) > 1 { + addrs = strings.Join(args[1:], " ") } - addrs := strings.Join(args[1:], " ") composer, _ := aerc.SelectedTab().(*widgets.Composer) switch args[0] { -- cgit v1.2.3