parameters: (self, argv, force_gnu=True)
return_statement: return new_argv
docstring: Processes command line args, but also allow args to be read from file.
      Args:
        argv: A list of strings, usually sys.argv[1:], which may contain one or
          more flagfile directives of the form --flagfile="./filename".
          Note that the name of the program (sys.argv[0]) should be omitted.
        force_gnu: If False, --flagfile parsing obeys normal flag semantics.
          If True, --flagfile parsing instead follows gnu_getopt semantics.
          *** WARNING *** force_gnu=False may become the future default!
  
      Returns:
  
        A new list which has the original list combined with what we read
        from any flagfile(s).
  
      References: Global gflags.FLAG class instance.
  
      This function should be called before the normal FLAGS(argv) call.
      This function scans the input list for a flag that looks like:
      --flagfile=<somefile>. Then it opens <somefile>, reads all valid key
      and value pairs and inserts them into the input list between the
      first item of the list and any subsequent items in the list.
  
      Note that your application's flags are still defined the usual way
      using gflags DEFINE_flag() type functions.
  
      Notes (assuming we're getting a commandline of some sort as our input):
      --> Flags from the command line argv _should_ always take precedence!
      --> A further "--flagfile=<otherfile.cfg>" CAN be nested in a flagfile.
          It will be processed after the parent flag file is done.
      --> For duplicate flags, first one we hit should "win".
      --> In a flagfile, a line beginning with # or // is a comment.
      --> Entirely blank lines _should_ be ignored.
docstring_summary: Processes command line args, but also allow args to be read from file.
      Args:
        argv: A list of strings, usually sys.argv[1:], which may contain one or
          more flagfile directives of the form --flagfile="./filename".
          Note that the name of the program (sys.argv[0]) should be omitted.
        force_gnu: If False, --flagfile parsing obeys normal flag semantics.
          If True, --flagfile parsing instead follows gnu_getopt semantics.
          *** WARNING *** force_gnu=False may become the future default!
docstring_tokens: Processes command line args but also allow args to be read from file . Args : argv : A list of strings usually sys . argv [ 1 : ] which may contain one or more flagfile directives of the form -- flagfile = . / filename . Note that the name of the program ( sys . argv [ 0 ] ) should be omitted . force_gnu : If False -- flagfile parsing obeys normal flag semantics . If True -- flagfile parsing instead follows gnu_getopt semantics . *** WARNING *** force_gnu = False may become the future default!
function: def ReadFlagsFromFiles(self, argv, force_gnu=True):
      """Processes command line args, but also allow args to be read from file.
      Args:
        argv: A list of strings, usually sys.argv[1:], which may contain one or
          more flagfile directives of the form --flagfile="./filename".
          Note that the name of the program (sys.argv[0]) should be omitted.
        force_gnu: If False, --flagfile parsing obeys normal flag semantics.
          If True, --flagfile parsing instead follows gnu_getopt semantics.
          *** WARNING *** force_gnu=False may become the future default!
  
      Returns:
  
        A new list which has the original list combined with what we read
        from any flagfile(s).
  
      References: Global gflags.FLAG class instance.
  
      This function should be called before the normal FLAGS(argv) call.
      This function scans the input list for a flag that looks like:
      --flagfile=<somefile>. Then it opens <somefile>, reads all valid key
      and value pairs and inserts them into the input list between the
      first item of the list and any subsequent items in the list.
  
      Note that your application's flags are still defined the usual way
      using gflags DEFINE_flag() type functions.
  
      Notes (assuming we're getting a commandline of some sort as our input):
      --> Flags from the command line argv _should_ always take precedence!
      --> A further "--flagfile=<otherfile.cfg>" CAN be nested in a flagfile.
          It will be processed after the parent flag file is done.
      --> For duplicate flags, first one we hit should "win".
      --> In a flagfile, a line beginning with # or // is a comment.
      --> Entirely blank lines _should_ be ignored.
      """
      parsed_file_list = []
      rest_of_args = argv
      new_argv = []
      while rest_of_args:
        current_arg = rest_of_args[0]
        rest_of_args = rest_of_args[1:]
        if self.__IsFlagFileDirective(current_arg):
          # This handles the case of -(-)flagfile foo.  In this case the
          # next arg really is part of this one.
          if current_arg == '--flagfile' or current_arg == '-flagfile':
            if not rest_of_args:
              raise IllegalFlagValue('--flagfile with no argument')
            flag_filename = os.path.expanduser(rest_of_args[0])
            rest_of_args = rest_of_args[1:]
          else:
            # This handles the case of (-)-flagfile=foo.
            flag_filename = self.ExtractFilename(current_arg)
          new_argv.extend(
              self.__GetFlagFileLines(flag_filename, parsed_file_list))
        else:
          new_argv.append(current_arg)
          # Stop parsing after '--', like getopt and gnu_getopt.
          if current_arg == '--':
            break
          # Stop parsing after a non-flag, like getopt.
          if not current_arg.startswith('-'):
            if not force_gnu and not self.__dict__['__use_gnu_getopt']:
              break
  
      if rest_of_args:
        new_argv.extend(rest_of_args)
  
      return new_argv
function_tokens: def ReadFlagsFromFiles ( self , argv , force_gnu = True ) : parsed_file_list = [ ] rest_of_args = argv new_argv = [ ] while rest_of_args : current_arg = rest_of_args [ 0 ] rest_of_args = rest_of_args [ 1 : ] if self . __IsFlagFileDirective ( current_arg ) : # This handles the case of -(-)flagfile foo.  In this case the # next arg really is part of this one. if current_arg == '--flagfile' or current_arg == '-flagfile' : if not rest_of_args : raise IllegalFlagValue ( '--flagfile with no argument' ) flag_filename = os . path . expanduser ( rest_of_args [ 0 ] ) rest_of_args = rest_of_args [ 1 : ] else : # This handles the case of (-)-flagfile=foo. flag_filename = self . ExtractFilename ( current_arg ) new_argv . extend ( self . __GetFlagFileLines ( flag_filename , parsed_file_list ) ) else : new_argv . append ( current_arg ) # Stop parsing after '--', like getopt and gnu_getopt. if current_arg == '--' : break # Stop parsing after a non-flag, like getopt. if not current_arg . startswith ( '-' ) : if not force_gnu and not self . __dict__ [ '__use_gnu_getopt' ] : break if rest_of_args : new_argv . extend ( rest_of_args ) return new_argv