From 10b6e1ca35d8c3297f22f132ee22b4a8a3e57fa9 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 1 Sep 2022 03:49:31 +0200 Subject: [PATCH] feat: Add initial fig support --- go.mod | 1 + go.sum | 2 ++ pkg/cmd/config.go | 2 ++ 3 files changed, 5 insertions(+) diff --git a/go.mod b/go.mod index 23d8f2311387..626e9ae56271 100644 --- a/go.mod +++ b/go.mod @@ -108,6 +108,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect + github.com/withfig/autocomplete-tools/integrations/cobra v1.2.1 // indirect github.com/xanzy/ssh-agent v0.3.2 // indirect github.com/yuin/goldmark v1.4.13 // indirect github.com/yuin/goldmark-emoji v1.0.1 // indirect diff --git a/go.sum b/go.sum index f1f1ca1f2a20..59f3688f5542 100644 --- a/go.sum +++ b/go.sum @@ -461,6 +461,8 @@ github.com/twpayne/go-xdg/v6 v6.0.0 h1:kt2KGpflK5q8ZpkmQfX6kJphh6+oAWikf4LiAZxFT github.com/twpayne/go-xdg/v6 v6.0.0/go.mod h1:XlfiGBU0iBxudVRWh+SXF+I1Cfb7rMq1IFwOprG4Ts8= 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/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xanzy/ssh-agent v0.3.2 h1:eKj4SX2Fe7mui28ZgnFW5fmTz1EIr7ugo5s6wDxdHBM= github.com/xanzy/ssh-agent v0.3.2/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= diff --git a/pkg/cmd/config.go b/pkg/cmd/config.go index 1084791dcb3b..297e7db983ec 100644 --- a/pkg/cmd/config.go +++ b/pkg/cmd/config.go @@ -41,6 +41,7 @@ import ( "github.com/twpayne/go-shell" "github.com/twpayne/go-vfs/v4" "github.com/twpayne/go-xdg/v6" + cobracompletefig "github.com/withfig/autocomplete-tools/integrations/cobra" "go.uber.org/multierr" "golang.org/x/term" "mvdan.cc/sh/v3/expand" @@ -1454,6 +1455,7 @@ func (c *Config) newRootCmd() (*cobra.Command, error) { c.newUpdateCmd(), c.newUpgradeCmd(), c.newVerifyCmd(), + cobracompletefig.CreateCompletionSpecCommand(), } { if cmd != nil { rootCmd.AddCommand(cmd)