Jim Paris
5844afed0b
git-svn-id: https://bucket.mit.edu/svn/nilm/nilmdb@9267 ddd99763-3ecb-0310-9145-efcb8ce7c51f
27 lines
647 B
Python
Executable File
27 lines
647 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
from nilmdb import Interval
|
|
from optparse import OptionParser
|
|
import sys
|
|
|
|
version = "1.0"
|
|
|
|
parser = OptionParser()
|
|
parser.add_option("-d", "--db", dest="database", metavar="DATABASE",
|
|
help="location of sqlite database")
|
|
parser.add_option("-V", "--version", dest="version", default=False, action="store_true",
|
|
help="print version then exit")
|
|
|
|
(options, args) = parser.parse_args()
|
|
|
|
if (options.version):
|
|
print "This script version: " + version
|
|
sys.exit(0)
|
|
|
|
if options.database is None:
|
|
print "Error: database is mandatory"
|
|
sys.exit(1)
|
|
|
|
print "Database is " + options.database
|
|
|