docs: def parseArgs (argv, defaults):
    """parseArgs(argv, defaults) -> (dict, list)
  
    Parses command-line arguments according to the given defaults.  For
    every key in defaults, an argument of the form --key=value will be
    parsed.  Numeric arguments are converted from strings with errors
    reported via ait.core.log.error() and default values used instead.
  
    Returns a copy of defaults with parsed option values and a list of
    any non-flag arguments.
    """
    options = dict(defaults)
    numeric = \
      [ k for k, v in options.items() if type(v) is float or type(v) is int ]
  
    try:
      longopts   = [ "%s=" % key for key in options.keys() ]
      opts, args = getopt.getopt(argv, "", longopts)
  
      for key, value in opts:
        if key.startswith("--"):
          key = key[2:]
        options[key] = value
    except getopt.GetoptError, err:
      log.error( str(err)  )
      usage( exit=True )
  
    for key in numeric:
      value = options[key]
      if type(value) is str:
        options[key] = util.toNumber(value)
  
      if options[key] is None:
        msg = "Option '%s': '%s' is not a number, using default '%s' instead."
        log.error(msg, key, value, defaults[key])
        options[key] = defaults[key]
  
    return options, args