Skip to content

Commit

Permalink
FlagParsingDisabled: fix positional completion
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Dec 19, 2023
1 parent 1ac5077 commit 2ac6458
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions example/cmd/disabled.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var disabledCmd = &cobra.Command{
Use: "disabled",
Short: "",
DisableFlagParsing: true,
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(disabledCmd).Standalone()

rootCmd.AddCommand(disabledCmd)

carapace.Gen(disabledCmd).PositionalCompletion(
carapace.ActionValues("p1", "positional1"),
carapace.ActionValues("p2", "positional2"),
)
}

0 comments on commit 2ac6458

Please sign in to comment.