Changed dbfile argument to be optional, default to ~/.dwtt.db
This commit is contained in:
parent
6a982d3a8c
commit
4779e75ffd
10
dwtt
10
dwtt
@ -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,10 +34,9 @@ def main(argv):
|
||||
usage()
|
||||
sys.exit(3)
|
||||
|
||||
if len(args) < 1:
|
||||
usage()
|
||||
sys.exit(2)
|
||||
timedbfile = args[0]
|
||||
timedbfile = os.path.expanduser('~') + os.path.sep + '.dwtt.db'
|
||||
if len(args) >= 1:
|
||||
timedbfile = args[0]
|
||||
|
||||
ds = DataStore(timedbfile)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user