def METHOD_NAME(args=None):
    parser = optparse.OptionParser("%prog wms-capabilities [options] URL",
        description="Read and parse WMS 1.1.1 capabilities and print out"
        " information about each layer. It does _not_ return a valid"
        " MapProxy configuration.")
    parser.add_option("--host", dest="capabilities_url",
        help="WMS Capabilites URL")
    parser.add_option("--version", dest="version",
        choices=['1.1.1', '1.3.0'], default='1.1.1', help="Request GetCapabilities-document in version 1.1.1 or 1.3.0", metavar="<1.1.1 or 1.3.0>")
    if args:
        args = args[1:] # remove script name
    (options, args) = parser.parse_args(args)
    if not options.capabilities_url:
        if len(args) != 1:
            parser.print_help()
            sys.exit(2)
        else:
            options.capabilities_url = args[0]
    try:
        service = parse_capabilities_url(options.capabilities_url, version=options.version)
        printer = PrettyPrinter(indent=4, version=options.version)
        printer.print_layers(service, root=True)
    except KeyError as ex:
        log_error('XML-Element has no such attribute (%s).' % (ex.args[0],))
        sys.exit(1)