Skip to content

Commit

Permalink
feat: Add initial fig support
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Sep 1, 2022
1 parent b4c65eb commit d772f38
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions go.mod
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Expand Up @@ -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=
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/config.go
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions pkg/cmd/testdata/scripts/generatefigspec.txtar
@@ -0,0 +1,3 @@
# test that chezmoi generate-fig-spec generates a Fig spec
exec chezmoi generate-fig-spec
stdout 'const completionSpec:'

0 comments on commit d772f38

Please sign in to comment.