code: func NewCmdCreateConfigMap(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
  	options := &ConfigMapOpts{
  		CreateSubcommandOptions: NewCreateSubcommandOptions(ioStreams),
  	}
  
  	cmd := &cobra.Command{
  		Use:                   "configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run]",
  		DisableFlagsInUseLine: true,
  		Aliases:               []string{"cm"},
  		Short:                 i18n.T("Create a configmap from a local file, directory or literal value"),
  		Long:                  configMapLong,
  		Example:               configMapExample,
  		Run: func(cmd *cobra.Command, args []string) {
  			cmdutil.CheckErr(options.Complete(f, cmd, args))
  			cmdutil.CheckErr(options.Run())
  		},
  	}
  
  	options.CreateSubcommandOptions.PrintFlags.AddFlags(cmd)
  
  	cmdutil.AddApplyAnnotationFlags(cmd)
  	cmdutil.AddValidateFlags(cmd)
  	cmdutil.AddGeneratorFlags(cmd, generateversioned.ConfigMapV1GeneratorName)
  	cmd.Flags().StringSlice("from-file", []string{}, "Key file can be specified using its file path, in which case file basename will be used as configmap key, or optionally with a key and file path, in which case the given key will be used.  Specifying a directory will iterate each named file in the directory whose basename is a valid configmap key.")
  	cmd.Flags().StringArray("from-literal", []string{}, "Specify a key and literal value to insert in configmap (i.e. mykey=somevalue)")
  	cmd.Flags().String("from-env-file", "", "Specify the path to a file to read lines of key=val pairs to create a configmap (i.e. a Docker .env file).")
  	cmd.Flags().Bool("append-hash", false, "Append a hash of the configmap to its name.")
  	return cmd
  }
docs: // NewCmdCreateConfigMap initializes and returns ConfigMapOpts