#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Oboinus, a X11 background previewer and setter
Copyright 2011 Suniobo <suniobo@fastmail.fm>

This file is part of Oboinus.

Oboinus is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Oboinus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Oboinus; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
"""

import sys
from oboinuslib.oboinus import App

app = App()

if sys.argv.count("--restore") or sys.argv.count("-r"):
    try:
        app.restore()
    except Exception, e:
        print e.message
        sys.exit(1)
elif sys.argv.count("-h") or sys.argv.count("--help"):
    sys.exit(app.usage())
else:
    sys.exit(app.main())
