code: func (o *EnvOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error {
  	if o.All && len(o.Selector) > 0 {
  		return fmt.Errorf("cannot set --all and --selector at the same time")
  	}
  	ok := false
  	o.resources, o.envArgs, ok = envutil.SplitEnvironmentFromResources(args)
  	if !ok {
  		return fmt.Errorf("all resources must be specified before environment changes: %s", strings.Join(args, " "))
  	}
  
  	o.updatePodSpecForObject = polymorphichelpers.UpdatePodSpecForObjectFn
  	o.output = cmdutil.GetFlagString(cmd, "output")
  	o.dryRun = cmdutil.GetDryRunFlag(cmd)
  
  	if o.dryRun {
  		// TODO(juanvallejo): This can be cleaned up even further by creating
  		// a PrintFlags struct that binds the --dry-run flag, and whose
  		// ToPrinter method returns a printer that understands how to print
  		// this success message.
  		o.PrintFlags.Complete("%s (dry run)")
  	}
  	printer, err := o.PrintFlags.ToPrinter()
  	if err != nil {
  		return err
  	}
  	o.PrintObj = printer.PrintObj
  
  	o.clientset, err = f.KubernetesClientSet()
  	if err != nil {
  		return err
  	}
  	o.namespace, o.enforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
  	if err != nil {
  		return err
  	}
  	o.builder = f.NewBuilder
  
  	return nil
  }
docs: // Complete completes all required options