def METHOD_NAME(args):
    logging.basicConfig(level=logging.WARNING, stream=sys.stderr)
    base_dir = find_repository_basedir('.')
    if args.safe and args.json:
        sys.stderr.write('The options --safe and --json are currently mutually exclusive\n')
        sys.exit(1)
    if args.safe:
        sys.stdout.write(
            'Repository:\n  Name: {repository}\n  Path: {base_dir}\n\n'.format(repository=get_repository_name(base_dir),
                                                                               base_dir=base_dir))
        safe_discover(base_dir)
        sys.exit(0)
    repository = find_and_scan_repositories(base_dir, include_locals=True)
    try:
        repository.load()
    except LeappError as exc:
        sys.stderr.write(exc.message)
        sys.stderr.write('\n')
        sys.exit(1)
    actors = repository.actors
    topics = [topic for topic in get_topics() if _is_local(repository, topic, base_dir, all_repos=args.all)]
    models = [model for model in get_models() if _is_local(repository, model, base_dir, all_repos=args.all)]
    tags = [tag for tag in get_tags() if _is_local(repository, tag, base_dir, all_repos=args.all)]
    workflows = [workflow for workflow in get_workflows() if _is_local(repository, workflow, base_dir,
                                                                       all_repos=args.all)]
    if not args.json:
        sys.stdout.write(
            'Repository:\n  Name: {repository}\n  Path: {base_dir}\n\n'.format(repository=get_repository_name(base_dir),
                                                                               base_dir=base_dir))
        _print_group('Actors', actors, name_resolver=lambda x: x.class_name, path_resolver=_get_actor_path)
        _print_group('Models', models)
        _print_group('Tags', tags)
        _print_group('Topics', topics)
        _print_group('Workflows', workflows)
    else:
        output = {
            'repository': get_repository_name(base_dir),
            'base_dir': base_dir,
            'topics': dict((topic.__name__, _get_topic_details(topic)) for topic in topics),
            'models': dict((model.__name__, _get_model_details(model)) for model in models),
            'actors': dict((actor.class_name, _get_actor_details(actor)) for actor in actors),
            'tags': dict((tag.name, _get_tag_details(tag)) for tag in tags),
            'workflows': dict((workflow.__name__, _get_workflow_details(workflow)) for workflow in workflows)
        }
        json.dump(output, sys.stdout, indent=2)
        sys.stdout.write('\n')