'The CLI command function for the `beet edit` command.'

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

    query = ui.decargs(args)
    (items, albums) = _do_query(lib, query, opts.album, False)
    objs = (albums if opts.album else items)
    if (not objs):
        ui.print_(u'Nothing    to    edit.')
        return
    if opts.all:
        fields = None
    else:
        fields = self._get_fields(opts.album, opts.field)
    self.edit(opts.album, objs, fields)
