'Print tag info or library data for each file referenced by args.
Main entry point for the `beet info ARGS...` command.
If an argument is a path pointing to an existing file, then the tags
of that file are printed. All other arguments are considered
queries, and for each item matching all those queries the tags from
the file are printed.
If `opts.summarize` is true, the function merges all tags into one
dictionary and only prints that. If two files have different values
for the same tag, the value is set to \'[various]\''

def run(self, lib, opts, args):

    if opts.library:
        data_collector = library_data
    else:
        data_collector = tag_data
    included_keys = []
    for keys in opts.included_keys:
        included_keys.extend(keys.split(','))
    key_filter = make_key_filter(included_keys)
    first = True
    summary = {}
    for data_emitter in data_collector(lib, ui.decargs(args)):
        try:
            (data, item) = data_emitter()
        except (mediafile.UnreadableFileError, IOError) as ex:
            self._log.error(u'cannot    read    file:    {0}', ex)
            continue
        data = key_filter(data)
        if opts.summarize:
            update_summary(summary, data)
        else:
            if (not first):
                ui.print_()
            if opts.keys_only:
                print_data_keys(data, item)
            else:
                fmt = (ui.decargs([opts.format])[0] if opts.format else None)
                print_data(data, item, fmt)
            first = False
    if opts.summarize:
        print_data(summary)
