code: func (o *SetServiceAccountOptions) 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.shortOutput = cmdutil.GetFlagString(cmd, "output") == "name"
  	o.dryRun = cmdutil.GetDryRunFlag(cmd)
  	o.output = cmdutil.GetFlagString(cmd, "output")
  	o.updatePodSpecForObject = polymorphichelpers.UpdatePodSpecForObjectFn
  
  	if o.dryRun {
  		o.PrintFlags.Complete("%s (dry run)")
  	}
  	printer, err := o.PrintFlags.ToPrinter()
  	if err != nil {
  		return err
  	}
  	o.PrintObj = printer.PrintObj
  
  	cmdNamespace, enforceNamespace, err := f.ToRawKubeConfigLoader().Namespace()
  	if err != nil {
  		return err
  	}
  	if len(args) == 0 {
  		return errors.New("serviceaccount is required")
  	}
  	o.serviceAccountName = args[len(args)-1]
  	resources := args[:len(args)-1]
  	builder := f.NewBuilder().
  		WithScheme(scheme.Scheme, scheme.Scheme.PrioritizedVersionsAllGroups()...).
  		LocalParam(o.local).
  		ContinueOnError().
  		NamespaceParam(cmdNamespace).DefaultNamespace().
  		FilenameParam(enforceNamespace, &o.fileNameOptions).
  		Flatten()
  	if !o.local {
  		builder.ResourceTypeOrNameArgs(o.all, resources...).
  			Latest()
  	}
  	o.infos, err = builder.Do().Infos()
  	if err != nil {
  		return err
  	}
  	return nil
  }
docs: // Complete configures serviceAccountConfig from command line args.