psu/cmd/completion.go
Juan Carlos Mejías Rodríguez c5b1dfaa82 Rewrite project in Go
2019-07-21 18:49:28 -04:00

29 lines
544 B
Go

package cmd
import (
"github.com/spf13/cobra"
"os"
)
// completionCmd represents the completion command
var completionCmd = &cobra.Command{
Use: "completion",
Short: "Generates bash completion scripts",
Long: `To load completion run
. <(psu completion)
To configure your bash shell to load completions for each session add to your bashrc
# ~/.bashrc or ~/.profile
. <(psu completion)
`,
Run: func(cmd *cobra.Command, args []string) {
rootCmd.GenBashCompletion(os.Stdout)
},
}
func init() {
rootCmd.AddCommand(completionCmd)
}