Files
go-garth-cli/python-garmin-connect/connect/completion.go
2025-09-21 11:03:52 -07:00

39 lines
802 B
Go

package main
import (
"os"
"github.com/spf13/cobra"
)
func init() {
completionCmd := &cobra.Command{
Use: "completion",
}
rootCmd.AddCommand(completionCmd)
completionBashCmd := &cobra.Command{
Use: "bash",
Short: "Output command completion for Bourne Again Shell (bash)",
RunE: completionBash,
Args: cobra.NoArgs,
}
completionCmd.AddCommand(completionBashCmd)
completionZshCmd := &cobra.Command{
Use: "zsh",
Short: "Output command completion for Z Shell (zsh)",
RunE: completionZsh,
Args: cobra.NoArgs,
}
completionCmd.AddCommand(completionZshCmd)
}
func completionBash(_ *cobra.Command, _ []string) error {
return rootCmd.GenBashCompletion(os.Stdout)
}
func completionZsh(_ *cobra.Command, _ []string) error {
return rootCmd.GenZshCompletion(os.Stdout)
}