From bfa3451af0a9b24ce0c8e72e81f0af2e3330a71a Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 27 May 2012 05:25:48 +0200 Subject: [PATCH] Add argparse configuration --- parse | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/parse b/parse index 6ed5443..8368ee1 100755 --- a/parse +++ b/parse @@ -1,3 +1,15 @@ #!/usr/bin/python -import os, email, glob, sqlite3 +import os, argpars, hashlib, email, glob, sqlite3 + +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='*', + help='glob pattern (including path) that has to be matched for a file to be parsed') + +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) +