Changed dbfile argument to be optional, default to ~/.dwtt.db
This commit is contained in:
1 parent
6a982d3a8c
commit
4779e75ffd
1 file changed
+4
-4
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
import getopt
|
||||
from datetime import datetime
|
||||
@@ -11,7 +12,7 @@ from DataStore import DataStore
|
||||
PROGRAM_NAME = 'dwtt'
|
||||
|
||||
def usage():
|
||||
print '''Usage: dwtt [options] <dbfile>
|
||||
print '''Usage: dwtt [options] [dbfile]
|
||||
Options:
|
||||
--help Show this help
|
||||
'''
|
||||
@@ -33,9 +34,8 @@ def main(argv):
|
||||
usage()
|
||||
sys.exit(3)
|
||||
|
||||
if len(args) < 1:
|
||||
usage()
|
||||
sys.exit(2)
|
||||
timedbfile = os.path.expanduser('~') + os.path.sep + '.dwtt.db'
|
||||
if len(args) >= 1:
|
||||
timedbfile = args[0]
|
||||
|
||||
ds = DataStore(timedbfile)
|
||||
|
||||
Reference in new issue
Block a user