cmd/completion.go
func CompletionCmd() *cobra.Command {
	return &cobra.Command{
		Use:   "completion",
		Short: "Generate completion code for bash and zsh shells.",
		Long: `completion is used to output completion code for bash and zsh shells.
	
	Before using completion features, you have to source completion code
	from your .profile. This is done by adding following line to one of above files:
		source <(kubicorn completion SHELL)
	Valid arguments for SHELL are: "bash" and "zsh".
	Notes:
	1) zsh completions requires zsh 5.2 or newer.
		
	2) macOS users have to install bash-completion framework to utilize
	completion features. This can be done using homebrew:
		brew install bash-completion
	Once installed, you must load bash_completion by adding following
	line to your .profile or .bashrc/.zshrc:
		source $(brew --prefix)/etc/bash_completion`,
		RunE: func(cmd *cobra.Command, args []string) error {
			if logger.Fabulous {
				cmd.SetOutput(logger.FabulousWriter)
			}

			if viper.GetString(keyTrueColor) != "" {
				cmd.SetOutput(logger.FabulousWriter)
			}

			switch len(args) {
			case 0:
				return fmt.Errorf("shell argument is not specified")
			default:
				switch args[0] {
				case "bash":
					return runBashGeneration()
				case "zsh":
					return runZshGeneration()
				default:
					return fmt.Errorf("invalid shell argument")
				}
			}
		},
	}
}
func CompletionCmd() *cobra.Command {
	return &cobra.Command{
		Use:   "completion",
		Short: "Generate completion code for bash and zsh shells.",
		Long: `completion is used to output completion code for bash and zsh shells.
	
	Before using completion features, you have to source completion code
	from your .profile. This is done by adding following line to one of above files:
		source <(kubicorn completion SHELL)
	Valid arguments for SHELL are: "bash" and "zsh".
	Notes:
	1) zsh completions requires zsh 5.2 or newer.
		
	2) macOS users have to install bash-completion framework to utilize
	completion features. This can be done using homebrew:
		brew install bash-completion
	Once installed, you must load bash_completion by adding following
	line to your .profile or .bashrc/.zshrc:
		source $(brew --prefix)/etc/bash_completion`,
		RunE: func(cmd *cobra.Command, args []string) error {
			if logger.Fabulous {
				cmd.SetOutput(logger.FabulousWriter)
			}

			if viper.GetString(keyTrueColor) != "" {
				cmd.SetOutput(logger.FabulousWriter)
			}

			switch len(args) {
			case 0:
				return fmt.Errorf("shell argument is not specified")
			default:
				switch args[0] {
				case "bash":
					return runBashGeneration()
				case "zsh":
					return runZshGeneration()
				default:
					return fmt.Errorf("invalid shell argument")
				}
			}
		},
	}
}
// CompletionCmd represents the completion command