Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AutoCompleteCmd = &cobra.Command{
Use: fmt.Sprintf("autocomplete [%s]", strings.Join(supportedShells, "|")),
Short: "Adds a completion script for your shell environment",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
shell := args[0]
profilePath, err := SetupAutocompletionForShell(cmd.Root(), shell)
if err != nil {
return err
}
fmt.Println("Autocomplete script generated and injected successfully.")
fmt.Printf("Please source your %s profile to apply the changes or restart your terminal.\n", shell)
fmt.Printf("For manual sourcing, use: source %s\n", profilePath)
if shell == "bash" {
fmt.Println("Please make sure that you have bash-completion installed in order to get full autocompletion functionality.")
fmt.Println("On how to install bash-completion, please refer to the following link: https://www.daytona.io/docs/tools/cli/#daytona-autocomplete")
}
return nil
},
}
Functions ¶
func DetectShellAndSetupAutocompletion ¶
func DetectShellAndSetupAutocompletion(rootCmd *cobra.Command) error
func SetupAutocompletionForShell ¶
func SetupAutocompletionForShell(rootCmd *cobra.Command, shell string) (string, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.