'Internal callback that sets the correct format while parsing CLI
arguments.'

def _set_format(self, option, opt_str, value, parser, target=None, fmt=None, store_true=False):

    if store_true:
        setattr(parser.values, option.dest, True)
    if fmt:
        value = fmt
    elif value:
        (value,) = decargs([value])
    else:
        value = u''
    parser.values.format = value
    if target:
        config[target._format_config_key].set(value)
    elif self._album_flags:
        if parser.values.album:
            target = library.Album
        elif (self._album_flags & set(parser.rargs)):
            target = library.Album
        else:
            target = library.Item
        config[target._format_config_key].set(value)
    else:
        config[library.Item._format_config_key].set(value)
        config[library.Album._format_config_key].set(value)
