From 39307a6fa7e96641b822ed0a9acb75021dcf7fe9 Mon Sep 17 00:00:00 2001 From: Jeffas Date: Fri, 20 Sep 2019 17:16:29 +0100 Subject: Make commands join args with spaces This patch ensures the following commands join their arguments with spaces to make it easier to interact with: - cf - mkdir - cd - attach - detach - ct - copy - move - save --- commands/compose/attach.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'commands/compose/attach.go') diff --git a/commands/compose/attach.go b/commands/compose/attach.go index 969d12e..2b633dc 100644 --- a/commands/compose/attach.go +++ b/commands/compose/attach.go @@ -3,6 +3,7 @@ package compose import ( "fmt" "os" + "strings" "time" "git.sr.ht/~sircmpwn/aerc/commands" @@ -22,20 +23,16 @@ func (Attach) Aliases() []string { } func (Attach) Complete(aerc *widgets.Aerc, args []string) []string { - path := "" - if len(args) >= 1 { - path = args[0] - } - + path := strings.Join(args, " ") return commands.CompletePath(path) } func (Attach) Execute(aerc *widgets.Aerc, args []string) error { - if len(args) != 2 { + if len(args) == 1 { return fmt.Errorf("Usage: :attach ") } - path := args[1] + path := strings.Join(args[1:], " ") path, err := homedir.Expand(path) if err != nil { -- cgit v1.2.3