code: func (o *ConfigMapOpts) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error {
  	name, err := NameFromCommandArgs(cmd, args)
  	if err != nil {
  		return err
  	}
  
  	var generator generate.StructuredGenerator
  	switch generatorName := cmdutil.GetFlagString(cmd, "generator"); generatorName {
  	case generateversioned.ConfigMapV1GeneratorName:
  		generator = &generateversioned.ConfigMapGeneratorV1{
  			Name:           name,
  			FileSources:    cmdutil.GetFlagStringSlice(cmd, "from-file"),
  			LiteralSources: cmdutil.GetFlagStringArray(cmd, "from-literal"),
  			EnvFileSource:  cmdutil.GetFlagString(cmd, "from-env-file"),
  			AppendHash:     cmdutil.GetFlagBool(cmd, "append-hash"),
  		}
  	default:
  		return errUnsupportedGenerator(cmd, generatorName)
  	}
  
  	return o.CreateSubcommandOptions.Complete(f, cmd, args, generator)
  }
docs: // Complete completes all the required options