code: func RunCompletion(out io.Writer, cmd *cobra.Command, root *cobra.Command, args []string) error {
  	var msg string
  	if len(args) == 0 {
  		msg = fmt.Sprintf("shell not specified.\nSee '%s -h' for help and examples.", cmd.CommandPath())
  		return s2ierr.UsageError(msg)
  	}
  	if len(args) > 1 {
  		msg = fmt.Sprintf("too many arguments. Expected only the shell type.\nSee '%s -h' for help and examples.", cmd.CommandPath())
  		return s2ierr.UsageError(msg)
  	}
  	run, found := completionShells[args[0]]
  	if !found {
  		msg = fmt.Sprintf("unsupported shell type %q.\nSee '%s -h' for help and examples.", args[0], cmd.CommandPath())
  		return s2ierr.UsageError(msg)
  	}
  
  	return run(out, root)
  }
docs: // RunCompletion first checks args[0] to decide compose zsh or bash
  // then write the content into the out bytes.Buffer
  // if command input error will call UsageError with `cmd cobra.Command`
  // `root cobra.Command` mainly for GenBashCompletion function