diff options
author | Jeffas <dev@jeffas.io> | 2019-09-20 17:16:29 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-09-20 15:06:34 -0400 |
commit | 39307a6fa7e96641b822ed0a9acb75021dcf7fe9 (patch) | |
tree | 683aec09eb86e2077148a53429681aa39776449b /commands/compose/detach.go | |
parent | 3ec9fd216d9e3b38d1d5abb5fba24199185f7054 (diff) | |
download | aerc-39307a6fa7e96641b822ed0a9acb75021dcf7fe9.tar.gz |
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
Diffstat (limited to 'commands/compose/detach.go')
-rw-r--r-- | commands/compose/detach.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/commands/compose/detach.go b/commands/compose/detach.go index dc70ff97..e8b07ed6 100644 --- a/commands/compose/detach.go +++ b/commands/compose/detach.go @@ -2,6 +2,7 @@ package compose import ( "fmt" + "strings" "time" "git.sr.ht/~sircmpwn/aerc/widgets" @@ -20,7 +21,6 @@ func (Detach) Aliases() []string { func (Detach) Complete(aerc *widgets.Aerc, args []string) []string { composer, _ := aerc.SelectedTab().(*widgets.Composer) - return composer.GetAttachments() } @@ -28,12 +28,8 @@ func (Detach) Execute(aerc *widgets.Aerc, args []string) error { var path string composer, _ := aerc.SelectedTab().(*widgets.Composer) - if len(args) > 2 { - return fmt.Errorf("Usage: :detach [path]") - } - - if len(args) == 2 { - path = args[1] + if len(args) > 1 { + path = strings.Join(args[1:], " ") } else { // if no attachment is specified, delete the first in the list atts := composer.GetAttachments() |