code: func (o *AnnotateOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error {
  	var err error
  
  	o.RecordFlags.Complete(cmd)
  	o.Recorder, err = o.RecordFlags.ToRecorder()
  	if err != nil {
  		return err
  	}
  
  	o.outputFormat = cmdutil.GetFlagString(cmd, "output")
  	o.dryrun = cmdutil.GetDryRunFlag(cmd)
  
  	if o.dryrun {
  		o.PrintFlags.Complete("%s (dry run)")
  	}
  	printer, err := o.PrintFlags.ToPrinter()
  	if err != nil {
  		return err
  	}
  	o.PrintObj = func(obj runtime.Object, out io.Writer) error {
  		return printer.PrintObj(obj, out)
  	}
  
  	o.namespace, o.enforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
  	if err != nil {
  		return err
  	}
  	o.builder = f.NewBuilder()
  	o.unstructuredClientForMapping = f.UnstructuredClientForMapping
  
  	// retrieves resource and annotation args from args
  	// also checks args to verify that all resources are specified before annotations
  	resources, annotationArgs, err := cmdutil.GetResourcesAndPairs(args, "annotation")
  	if err != nil {
  		return err
  	}
  	o.resources = resources
  	o.newAnnotations, o.removeAnnotations, err = parseAnnotations(annotationArgs)
  	if err != nil {
  		return err
  	}
  
  	return nil
  }
docs: // Complete adapts from the command line args and factory to the data required.