passing command back to main program

This commit is contained in:
Josh Holtrop committed 2010-12-03 00:45:29 -05:00
1 parent 40d433d815
commit df2d40afb2
2 files changed
+6 -1

No files matched your search

+3 -1
View File
@@ -25,12 +25,14 @@ def main(argv):
sys.exit(1)
timedbfile = os.path.expanduser('~/.' + PROGRAM_NAME + '.db')
timenow = datetime.now()
for opt, arg in opts:
if opt in ("-d", "--dbfile"):
timedbfile = arg
elif opt == '-c':
cmd = doCmdWindow()
print "cmd was:", cmd
elif opt == "--help":
usage()
sys.exit()
@@ -49,7 +51,7 @@ def createdb(dbfile):
def doCmdWindow():
c = CmdWindow()
c.main()
return c.main()
if __name__ == "__main__":
main(sys.argv)