import click
import pathlib
import toleo
import xdg.BaseDirectory
from .table import create_table


@click.command()
@click.option('--collection', '-c', 'collection_name', default='default')
def cli(collection_name):
    ''' Entry point for application. '''
    xdg_config_home = pathlib.Path(xdg.BaseDirectory.xdg_config_home)
    config_dir = xdg_config_home / 'toleo'
    config = (config_dir / collection_name).with_suffix('.yaml')
    collection = toleo.Collection(config)
    results = toleo.process(collection)
    table = create_table(results)
    print(table)

@@ -429,16 +429,29 @@
 .yaml')%0A
+    try:%0A    
     coll
@@ -484,16 +484,256 @@
 config)%0A
+    except OSError as err:%0A        msg = 'no config for collection %22%7B%7D%22 (%7B%7D)'%0A        raise click.ClickException(msg.format(config.stem, err.filename))%0A    except AttributeError as err:%0A        raise click.ClickException(err)%0A    else:%0A    
     resu
@@ -764,16 +764,20 @@
 ection)%0A
+    
     tabl
@@ -802,16 +802,20 @@
 esults)%0A
+    
     prin

handle basic exceptions from config file parsing