code: func NewCmdEdit(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
  	o := editor.NewEditOptions(editor.NormalEditMode, ioStreams)
  	o.ValidateOptions = cmdutil.ValidateOptions{EnableValidation: true}
  
  	cmd := &cobra.Command{
  		Use:                   "edit (RESOURCE/NAME | -f FILENAME)",
  		DisableFlagsInUseLine: true,
  		Short:                 i18n.T("Edit a resource on the server"),
  		Long:                  editLong,
  		Example:               fmt.Sprintf(editExample),
  		Run: func(cmd *cobra.Command, args []string) {
  			if err := o.Complete(f, args, cmd); err != nil {
  				cmdutil.CheckErr(err)
  			}
  			if err := o.Run(); err != nil {
  				cmdutil.CheckErr(err)
  			}
  		},
  	}
  
  	// bind flag structs
  	o.RecordFlags.AddFlags(cmd)
  	o.PrintFlags.AddFlags(cmd)
  
  	usage := "to use to edit the resource"
  	cmdutil.AddFilenameOptionFlags(cmd, &o.FilenameOptions, usage)
  	cmdutil.AddValidateOptionFlags(cmd, &o.ValidateOptions)
  	cmd.Flags().BoolVarP(&o.OutputPatch, "output-patch", "", o.OutputPatch, "Output the patch if the resource is edited.")
  	cmd.Flags().BoolVar(&o.WindowsLineEndings, "windows-line-endings", o.WindowsLineEndings,
  		"Defaults to the line ending native to your platform.")
  
  	cmdutil.AddApplyAnnotationVarFlags(cmd, &o.ApplyAnnotation)
  	cmdutil.AddIncludeUninitializedFlag(cmd)
  	return cmd
  }
docs: // NewCmdEdit creates the `edit` command