code: func RunVersion(out io.Writer, cmd *cobra.Command) error {
  	klog.V(1).Infoln("[version] retrieving version info")
  	clientVersion := version.Get()
  	v := Version{
  		ClientVersion: &clientVersion,
  	}
  
  	const flag = "output"
  	of, err := cmd.Flags().GetString(flag)
  	if err != nil {
  		klog.Fatalf("error accessing flag %s for command %s: %v", flag, cmd.Name(), err)
  	}
  
  	switch of {
  	case "":
  		fmt.Fprintf(out, "kubeadm version: %#v\n", v.ClientVersion)
  	case "short":
  		fmt.Fprintf(out, "%s\n", v.ClientVersion.GitVersion)
  	case "yaml":
  		y, err := yaml.Marshal(&v)
  		if err != nil {
  			return err
  		}
  		fmt.Fprintln(out, string(y))
  	case "json":
  		y, err := json.MarshalIndent(&v, "", "  ")
  		if err != nil {
  			return err
  		}
  		fmt.Fprintln(out, string(y))
  	default:
  		return errors.Errorf("invalid output format: %s", of)
  	}
  
  	return nil
  }
docs: // RunVersion provides the version information of kubeadm in format depending on arguments
  // specified in cobra.Command.