parameters: (options)
return_statement: return flags
docstring: Given a parsed options object, and taking the environment variables into
    account, returns a list of flags that should regenerate an equivalent options
    object (even in the absence of the environment variables.)
  
    Any path options will be normalized relative to depth.
  
    The format flag is not included, as it is assumed the calling generator will
    set that as appropriate.
docstring_summary: Given a parsed options object, and taking the environment variables into
    account, returns a list of flags that should regenerate an equivalent options
    object (even in the absence of the environment variables.)
docstring_tokens: Given a parsed options object and taking the environment variables into account returns a list of flags that should regenerate an equivalent options object ( even in the absence of the environment variables . )
function: def RegenerateFlags(options):
      """Given a parsed options object, and taking the environment variables into
    account, returns a list of flags that should regenerate an equivalent options
    object (even in the absence of the environment variables.)
  
    Any path options will be normalized relative to depth.
  
    The format flag is not included, as it is assumed the calling generator will
    set that as appropriate.
    """
  
      def FixPath(path):
          path = gyp.common.FixIfRelativePath(path, options.depth)
          if not path:
              return os.path.curdir
          return path
  
      def Noop(value):
          return value
  
      # We always want to ignore the environment when regenerating, to avoid
      # duplicate or changed flags in the environment at the time of regeneration.
      flags = ["--ignore-environment"]
      for name, metadata in options._regeneration_metadata.items():
          opt = metadata["opt"]
          value = getattr(options, name)
          value_predicate = metadata["type"] == "path" and FixPath or Noop
          action = metadata["action"]
          env_name = metadata["env_name"]
          if action == "append":
              flags.extend(
                  RegenerateAppendFlag(opt, value, value_predicate, env_name, options)
              )
          elif action in ("store", None):  # None is a synonym for 'store'.
              if value:
                  flags.append(FormatOpt(opt, value_predicate(value)))
              elif options.use_environment and env_name and os.environ.get(env_name):
                  flags.append(FormatOpt(opt, value_predicate(os.environ.get(env_name))))
          elif action in ("store_true", "store_false"):
              if (action == "store_true" and value) or (
                  action == "store_false" and not value
              ):
                  flags.append(opt)
              elif options.use_environment and env_name:
                  print(
                      "Warning: environment regeneration unimplemented "
                      "for %s flag %r env_name %r" % (action, opt, env_name),
                      file=sys.stderr,
                  )
          else:
              print(
                  "Warning: regeneration unimplemented for action %r "
                  "flag %r" % (action, opt),
                  file=sys.stderr,
              )
  
      return flags
function_tokens: def RegenerateFlags ( options ) : def FixPath ( path ) : path = gyp . common . FixIfRelativePath ( path , options . depth ) if not path : return os . path . curdir return path def Noop ( value ) : return value # We always want to ignore the environment when regenerating, to avoid # duplicate or changed flags in the environment at the time of regeneration. flags = [ "--ignore-environment" ] for name , metadata in options . _regeneration_metadata . items ( ) : opt = metadata [ "opt" ] value = getattr ( options , name ) value_predicate = metadata [ "type" ] == "path" and FixPath or Noop action = metadata [ "action" ] env_name = metadata [ "env_name" ] if action == "append" : flags . extend ( RegenerateAppendFlag ( opt , value , value_predicate , env_name , options ) ) elif action in ( "store" , None ) : # None is a synonym for 'store'. if value : flags . append ( FormatOpt ( opt , value_predicate ( value ) ) ) elif options . use_environment and env_name and os . environ . get ( env_name ) : flags . append ( FormatOpt ( opt , value_predicate ( os . environ . get ( env_name ) ) ) ) elif action in ( "store_true" , "store_false" ) : if ( action == "store_true" and value ) or ( action == "store_false" and not value ) : flags . append ( opt ) elif options . use_environment and env_name : print ( "Warning: environment regeneration unimplemented " "for %s flag %r env_name %r" % ( action , opt , env_name ) , file = sys . stderr , ) else : print ( "Warning: regeneration unimplemented for action %r " "flag %r" % ( action , opt ) , file = sys . stderr , ) return flags