From 1f03ef617a6857698b5a862db3a685cb8ad387e0 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 27 May 2012 10:19:17 +0200 Subject: [PATCH] Allow specifying of a database file to use --- parse | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/parse b/parse index 1521769..77d89fd 100755 --- a/parse +++ b/parse @@ -33,16 +33,19 @@ def get_charset(part): parser = argparse.ArgumentParser(description='Parses emails into an SQLite database, and optionally renders static HTML files.') -parser.add_argument('-p', '--pattern', dest='pattern', action='store', default='*', +parser.add_argument('-p', dest='pattern', action='store', default='*', help='glob pattern (including path) that has to be matched for a file to be parsed') +parser.add_argument('-d', dest='database', action='store', default='emails.db', + help='path of the database that should be used to store the emails (will be created if it does not exist yet)') + parser.add_argument('-r', '--render', dest='render', action='store_true', help='render static HTML files using the template files in templates/') args = parser.parse_args() options = vars(args) -database = sqlite3.connect('emails.db') +database = sqlite3.connect(options['database']) cursor = database.cursor() try: