From abe228b14d97d8d47e8ff4406de387fac45cfe68 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sun, 22 Oct 2023 23:23:18 +0200 Subject: commands: use completion from go-opt Implement command completion with complete struct field tags from the get-opt library introduced earlier. Changelog-changed: Improved command completion. Signed-off-by: Robin Jarry Reviewed-by: Koni Marti Tested-by: Moritz Poldrack Tested-by: Inwit --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index dc7d0267..75069e13 100644 --- a/main.go +++ b/main.go @@ -143,7 +143,7 @@ func getCompletions(cmdline string) ([]string, string) { for _, set := range cmds { for _, n := range set.Names() { if strings.HasPrefix(n, cmdline) { - completions = append(completions, n) + completions = append(completions, n+" ") } } } -- cgit