diff --git a/cmd/carapace/cmd/style.go b/cmd/carapace/cmd/style.go index c11a1e2263..cc8990a70c 100644 --- a/cmd/carapace/cmd/style.go +++ b/cmd/carapace/cmd/style.go @@ -14,7 +14,7 @@ var styleCmd = &cobra.Command{ Short: "", Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - if err := setStyle(args[1]); err != nil { + if err := setStyle(args[0]); err != nil { fmt.Fprintln(cmd.ErrOrStderr(), err.Error()) } }, @@ -23,6 +23,9 @@ var styleCmd = &cobra.Command{ func init() { carapace.Gen(styleCmd).Standalone() + carapace.Gen(styleCmd).PositionalAnyCompletion( + carapace.ActionStyleConfig(), + ) } func setStyle(s string) error {