Skip to content

Commit

Permalink
Don't install VCSs for completion requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffFaer committed Feb 18, 2024
1 parent 6a4100a commit d87fc65
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ var rootCmd = &cobra.Command{
CompletionOptions: cobra.CompletionOptions{
HiddenDefaultCmd: true,
},
PersistentPreRunE: func(*cobra.Command, []string) error {
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
if cmd.Name() == "completion" {
return nil
}
slog.SetDefault(slog.New(console.NewHandler(os.Stderr, &console.HandlerOptions{
Level: levels[min(verbosity, len(levels)-1)],
TimeFormat: time.RFC3339,
Expand Down

0 comments on commit d87fc65

Please sign in to comment.