#!/usr/bin/env python

from collage.main import Application
from time import sleep

import sys

if '--help' in sys.argv:
    print """Usage: collage-create options [query [query [...]]]
Options:
  --help      Display usage info and exit.
  --version   Display version info and exit.
"""
    sys.exit()

if '--version' in sys.argv:
    print "0.1.0"
    sys.exit()

queries = [arg for arg in sys.argv[1:] if arg]

app = Application()
app.run(queries)

if raw_input("Show the collages? (Y/n): ").lower()[:1] != 'n':
    for path in app.collage_paths:
        app.show_image(path)
        sleep(1.5)
