Files
whipper-gui/morituri/rip/main.py
Thomas Vander Stichele 9e3e1d53cb * morituri/rip/Makefile.am:
* morituri/rip/main.py:
	* morituri/rip/offset.py (added):
	  Add first command, 'rip offset find'
2009-05-23 09:00:03 +00:00

49 lines
1.2 KiB
Python

# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
import sys
from morituri.common import log, logcommand
from morituri.rip import offset
def main(argv):
c = Rip()
try:
ret = c.parse(argv)
except SystemError, e:
sys.stderr.write('rip: error: %s\n' % e.args)
return 255
except ImportError, e:
# FIXME: decide how to handle
raise
# deps.handleImportError(e)
# ret = -1
if ret is None:
return 0
return ret
class Rip(logcommand.LogCommand):
usage = "%prog %command"
description = """Rip rips CD's.
Rip gives you a tree of subcommands to work with.
You can get help on subcommands by using the -h option to the subcommand.
"""
subCommandClasses = [offset.Offset, ]
def addOptions(self):
# FIXME: is this the right place ?
log.init()
self.parser.add_option('-v', '--version',
action="store_true", dest="version",
help="show version information")
def handleOptions(self, options):
if options.version:
from morituri.configure import configure
print "rip %s" % configure.version
sys.exit(0)