def METHOD_NAME(self, *args, **options):
    # collect input parameters
    self.verbosity = int(options.get('verbosity', 1))
    print_json = bool(options.get('json_dump', False))
    filename = options.get('filename', '-')
    # get the range types
    wms_opts = WMSRenderOptions.objects.select_related('coverage')
    if args:
        wms_opts = wms_opts.filter(coverage__identifier__in=args)
    else:
        wms_opts = wms_opts.all()
    # select the right output formatter
    if print_json:
        output_formatter = output_json
    else:
        output_formatter = output_detailed
    # write the output
    try:
        with (stdout if filename == "-" else open(filename, "w")) as fout:
            for item in output_formatter(wms_opts):
                fout.write(item)
    except IOError as exc:
        raise CommandError(
            "Failed to write the output file %r! %s" % (filename, str(exc))
        )