mirror of https://github.com/fluxcd/flux2.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
496 B
Go
29 lines
496 B
Go
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
|
||
|
"github.com/spf13/cobra"
|
||
|
)
|
||
|
|
||
|
var completionCmd = &cobra.Command{
|
||
|
Use: "completion",
|
||
|
Short: "Generates bash completion scripts",
|
||
|
Example: `To load completion run
|
||
|
|
||
|
. <(tk completion)
|
||
|
|
||
|
To configure your bash shell to load completions for each session add to your bashrc
|
||
|
|
||
|
# ~/.bashrc or ~/.profile
|
||
|
. <(tk completion)
|
||
|
`,
|
||
|
Run: func(cmd *cobra.Command, args []string) {
|
||
|
rootCmd.GenBashCompletion(os.Stdout)
|
||
|
},
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
rootCmd.AddCommand(completionCmd)
|
||
|
}
|