From fac8135b6ba9169449730f74c49665dbd412b9e4 Mon Sep 17 00:00:00 2001 From: Engin Diri Date: Mon, 22 Aug 2022 03:28:57 +0300 Subject: [PATCH] feat: add fig autocomplete support (#3329) This PR releates to #3328 and fix the first part of the doings in the issue --- cmd/root.go | 3 ++- go.mod | 1 + go.sum | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index 0764405e169..98e57576369 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -9,6 +9,7 @@ import ( "github.com/charmbracelet/lipgloss" "github.com/goreleaser/goreleaser/pkg/context" "github.com/spf13/cobra" + cobracompletefig "github.com/withfig/autocomplete-tools/integrations/cobra" ) var boldStyle = lipgloss.NewStyle().Bold(true) @@ -82,8 +83,8 @@ Check out our website for more information, examples and documentation: https:// newDocsCmd().cmd, newManCmd().cmd, newSchemaCmd().cmd, + cobracompletefig.CreateCompletionSpecCommand(), ) - root.cmd = cmd return root } diff --git a/go.mod b/go.mod index 9e2bcb05bd3..8c10685fa69 100644 --- a/go.mod +++ b/go.mod @@ -142,6 +142,7 @@ require ( github.com/sergi/go-diff v1.2.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/technoweenie/multipartstreamer v1.0.1 // indirect + github.com/withfig/autocomplete-tools/integrations/cobra v1.2.1 // indirect github.com/xanzy/ssh-agent v0.3.1 // indirect gitlab.com/digitalxero/go-conventional-commit v1.0.7 // indirect go.opencensus.io v0.23.0 // indirect diff --git a/go.sum b/go.sum index e85d55965dc..72b877556b5 100644 --- a/go.sum +++ b/go.sum @@ -659,6 +659,8 @@ github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVM github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/withfig/autocomplete-tools/integrations/cobra v1.2.1 h1:+dBg5k7nuTE38VVdoroRsT0Z88fmvdYrI2EjzJst35I= +github.com/withfig/autocomplete-tools/integrations/cobra v1.2.1/go.mod h1:nmuySobZb4kFgFy6BptpXp/BBw+xFSyvVPP6auoJB4k= github.com/xanzy/go-gitlab v0.72.0 h1:/9BQTftUE7GRK/RO1eeWxG1cOE+tjwBrvRdpkeSOq6w= github.com/xanzy/go-gitlab v0.72.0/go.mod h1:d/a0vswScO7Agg1CZNz15Ic6SSvBG9vfw8egL99t4kA= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=