~sircmpwn/aerc

Joining the args in cf for folders with spaces v1 PROPOSED

Thanks!

To git.sr.ht:~sircmpwn/aerc
   f6df46d..4d95676  master -> master
David Acconcio
I sent an email to the unsubscribe box twice, but I still keep getting these emails.. Can someone unsubscribe me? 
> On Aug 8, 2019, at 2:39 PM, Ben Cohen <ben@bencohen.net> wrote:
> 
> ---
> commands/account/cf.go | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/commands/account/cf.go b/commands/account/cf.go
> index f078984..f318374 100644
> --- a/commands/account/cf.go
> +++ b/commands/account/cf.go
> @@ -2,6 +2,7 @@ package account
> 
> import (
> "errors"
> +	"strings"
> 
> "git.sr.ht/~sircmpwn/aerc/commands"
> "git.sr.ht/~sircmpwn/aerc/widgets"
> @@ -27,7 +28,7 @@ func (_ ChangeFolder) Complete(aerc *widgets.Aerc, args []string) []string {
> }
> 
> func (_ ChangeFolder) Execute(aerc *widgets.Aerc, args []string) error {
> -	if len(args) != 2 {
> +	if len(args) < 2 {
> return errors.New("Usage: cf <folder>")
> }
> acct := aerc.SelectedAccount()
> @@ -42,6 +43,9 @@ func (_ ChangeFolder) Execute(aerc *widgets.Aerc, args []string) error {
> return errors.New("No previous folder to return to")
> }
> } else {
> +		if len(args) > 2 {
> +			args[1] = strings.Join(args[1:], " ")
> +		}
> acct.Directories().Select(args[1])
> }
> history[acct.Name()] = previous
> -- 
> 2.22.0
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/%3C20190808183933.6942-1-ben%40bencohen.net%3E/mbox | git am -3
Learn more about email & git

[PATCH] Joining the args in cf for folders with spaces Export this patch

---
 commands/account/cf.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/commands/account/cf.go b/commands/account/cf.go
index f078984..f318374 100644
--- a/commands/account/cf.go
+++ b/commands/account/cf.go
@@ -2,6 +2,7 @@ package account
 
 import (
 	"errors"
+	"strings"
 
 	"git.sr.ht/~sircmpwn/aerc/commands"
 	"git.sr.ht/~sircmpwn/aerc/widgets"
@@ -27,7 +28,7 @@ func (_ ChangeFolder) Complete(aerc *widgets.Aerc, args []string) []string {
 }
 
 func (_ ChangeFolder) Execute(aerc *widgets.Aerc, args []string) error {
-	if len(args) != 2 {
+	if len(args) < 2 {
 		return errors.New("Usage: cf <folder>")
 	}
 	acct := aerc.SelectedAccount()
@@ -42,6 +43,9 @@ func (_ ChangeFolder) Execute(aerc *widgets.Aerc, args []string) error {
 			return errors.New("No previous folder to return to")
 		}
 	} else {
+		if len(args) > 2 {
+			args[1] = strings.Join(args[1:], " ")
+		}
 		acct.Directories().Select(args[1])
 	}
 	history[acct.Name()] = previous
-- 
2.22.0
Thanks!

To git.sr.ht:~sircmpwn/aerc
   f6df46d..4d95676  master -> master
David Acconcio
I sent an email to the unsubscribe box twice, but I still keep getting these emails.. Can someone unsubscribe me? 
> On Aug 8, 2019, at 2:39 PM, Ben Cohen <ben@bencohen.net> wrote:
> 
> ---
> commands/account/cf.go | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/commands/account/cf.go b/commands/account/cf.go
> index f078984..f318374 100644
> --- a/commands/account/cf.go
> +++ b/commands/account/cf.go
> @@ -2,6 +2,7 @@ package account
> 
> import (
> "errors"
> +	"strings"
> 
> "git.sr.ht/~sircmpwn/aerc/commands"
> "git.sr.ht/~sircmpwn/aerc/widgets"
> @@ -27,7 +28,7 @@ func (_ ChangeFolder) Complete(aerc *widgets.Aerc, args []string) []string {
> }
> 
> func (_ ChangeFolder) Execute(aerc *widgets.Aerc, args []string) error {
> -	if len(args) != 2 {
> +	if len(args) < 2 {
> return errors.New("Usage: cf <folder>")
> }
> acct := aerc.SelectedAccount()
> @@ -42,6 +43,9 @@ func (_ ChangeFolder) Execute(aerc *widgets.Aerc, args []string) error {
> return errors.New("No previous folder to return to")
> }
> } else {
> +		if len(args) > 2 {
> +			args[1] = strings.Join(args[1:], " ")
> +		}
> acct.Directories().Select(args[1])
> }
> history[acct.Name()] = previous
> -- 
> 2.22.0
View this thread in the archives