~rjarry/aerc-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH aerc v2] help: add completions

Details
Message ID
<20220519234437.79326-1-tim@timculverhouse.com>
DKIM signature
pass
Download raw message
Patch: +15 -2
Add :help completion arguments (config, imap, etc). The option "aerc"
brings up the general manpage

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
---
v2: use CompletionFromList to get fuzzy completion ability

 commands/help.go | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/commands/help.go b/commands/help.go
index 5bc8f0e..6efaf4d 100644
--- a/commands/help.go
+++ b/commands/help.go
@@ -8,6 +8,19 @@ import (

type Help struct{}

var pages = []string{
	"aerc",
	"config",
	"imap",
	"notmuch",
	"search",
	"sendmail",
	"smtp",
	"stylesets",
	"templates",
	"tutorial",
}

func init() {
	register(Help{})
}
@@ -17,12 +30,12 @@ func (Help) Aliases() []string {
}

func (Help) Complete(aerc *widgets.Aerc, args []string) []string {
	return nil
	return CompletionFromList(aerc, pages, args)
}

func (Help) Execute(aerc *widgets.Aerc, args []string) error {
	page := "aerc"
	if len(args) == 2 {
	if len(args) == 2 && args[1] != "aerc" {
		page = "aerc-" + args[1]
	} else if len(args) > 2 {
		return errors.New("Usage: help [topic]")
-- 
2.36.1

[aerc/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CK452PC3KGCM.3TQXKVWXXN9LC@cirno2>
In-Reply-To
<20220519234437.79326-1-tim@timculverhouse.com> (view parent)
DKIM signature
missing
Download raw message
aerc/patches: SUCCESS in 4m44s

[help: add completions][0] v2 from [Tim Culverhouse][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/32402
[1]: tim@timculverhouse.com

✓ #762245 SUCCESS aerc/patches/fedora-latest.yml https://builds.sr.ht/~rjarry/job/762245
✓ #762246 SUCCESS aerc/patches/openbsd.yml       https://builds.sr.ht/~rjarry/job/762246
✓ #762243 SUCCESS aerc/patches/alpine-edge.yml   https://builds.sr.ht/~rjarry/job/762243
✓ #762244 SUCCESS aerc/patches/debian-stable.yml https://builds.sr.ht/~rjarry/job/762244
Details
Message ID
<CK4BCTFST4FA.26S2TPFCY0EWR@kfn52>
In-Reply-To
<20220519234437.79326-1-tim@timculverhouse.com> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
On Fri May 20, 2022 at 1:44 AM CEST, Tim Culverhouse wrote:
> Add :help completion arguments (config, imap, etc). The option "aerc"
> brings up the general manpage
>
> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
> ---

Acked-by: Koni Marti <koni.marti@gmail.com>

> v2: use CompletionFromList to get fuzzy completion ability
>
>  commands/help.go | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/commands/help.go b/commands/help.go
> index 5bc8f0e..6efaf4d 100644
> --- a/commands/help.go
> +++ b/commands/help.go
> @@ -8,6 +8,19 @@ import (
>  
>  type Help struct{}
>  
> +var pages = []string{
> +	"aerc",
> +	"config",
> +	"imap",
> +	"notmuch",
> +	"search",
> +	"sendmail",
> +	"smtp",
> +	"stylesets",
> +	"templates",
> +	"tutorial",
> +}
> +
>  func init() {
>  	register(Help{})
>  }
> @@ -17,12 +30,12 @@ func (Help) Aliases() []string {
>  }
>  
>  func (Help) Complete(aerc *widgets.Aerc, args []string) []string {
> -	return nil
> +	return CompletionFromList(aerc, pages, args)
>  }
>  
>  func (Help) Execute(aerc *widgets.Aerc, args []string) error {
>  	page := "aerc"
> -	if len(args) == 2 {
> +	if len(args) == 2 && args[1] != "aerc" {
>  		page = "aerc-" + args[1]
>  	} else if len(args) > 2 {
>  		return errors.New("Usage: help [topic]")
> -- 
> 2.36.1
Details
Message ID
<CK7DTEVKF5WL.24OD2WVA6PKTK@marty>
In-Reply-To
<20220519234437.79326-1-tim@timculverhouse.com> (view parent)
DKIM signature
missing
Download raw message
Tim Culverhouse, May 20, 2022 at 01:44:
> Add :help completion arguments (config, imap, etc). The option "aerc"
> brings up the general manpage
>
> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>

Applied on master. Thanks!
Reply to thread Export thread (mbox)