mirror of
https://github.com/rsteube/carapace-bin.git
synced 2025-05-05 15:32:53 +00:00
23 lines
472 B
Go
23 lines
472 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/carapace-sh/carapace"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var completionCmd = &cobra.Command{
|
|
Use: "completion SHELL",
|
|
Short: "Output shell completion code for the specified shell (bash or zsh)",
|
|
Run: func(cmd *cobra.Command, args []string) {},
|
|
}
|
|
|
|
func init() {
|
|
carapace.Gen(completionCmd).Standalone()
|
|
|
|
rootCmd.AddCommand(completionCmd)
|
|
|
|
carapace.Gen(completionCmd).PositionalCompletion(
|
|
carapace.ActionValues("bash", "zsh"),
|
|
)
|
|
}
|