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
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import getopt
|
import getopt
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -11,7 +12,7 @@ from DataStore import DataStore
|
|||||||
PROGRAM_NAME = 'dwtt'
|
PROGRAM_NAME = 'dwtt'
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print '''Usage: dwtt [options] <dbfile>
|
print '''Usage: dwtt [options] [dbfile]
|
||||||
Options:
|
Options:
|
||||||
--help Show this help
|
--help Show this help
|
||||||
'''
|
'''
|
||||||
@ -33,10 +34,9 @@ def main(argv):
|
|||||||
usage()
|
usage()
|
||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
|
|
||||||
if len(args) < 1:
|
timedbfile = os.path.expanduser('~') + os.path.sep + '.dwtt.db'
|
||||||
usage()
|
if len(args) >= 1:
|
||||||
sys.exit(2)
|
timedbfile = args[0]
|
||||||
timedbfile = args[0]
|
|
||||||
|
|
||||||
ds = DataStore(timedbfile)
|
ds = DataStore(timedbfile)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user