aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordx <aryadevchavali1@gmail.com>2020-05-05 22:12:54 +0100
committerdx <aryadevchavali1@gmail.com>2020-05-05 22:12:54 +0100
commitdf722396877ef76ffd1a5701b96173f9b647b3fa (patch)
treeb34c753077f771af8ff2a9511f5bdddaa7d9e897
parentbc141f017a44d06533fe8f885e50445f2a354c84 (diff)
downloadmdhtml-df722396877ef76ffd1a5701b96173f9b647b3fa.tar.gz
mdhtml-df722396877ef76ffd1a5701b96173f9b647b3fa.tar.bz2
mdhtml-df722396877ef76ffd1a5701b96173f9b647b3fa.zip
+option parsing capability
This allows for command line arguments. Currently have -i and -o: -i for initial template html -o for the output type (date or filename)
-rw-r--r--converter.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/converter.py b/converter.py
index e5a0d9b..07944f4 100644
--- a/converter.py
+++ b/converter.py
@@ -1 +1,15 @@
#!/usr/bin/env python3
+
+from optparse import OptionParser
+"""Command line arguments"""
+usage = "usage: %prog [options] file..."
+parser = OptionParser(usage=usage)
+parser.add_option('-i', '--initial-html', dest='header',
+ help='File for initial template of compiled HTML',
+ default='initial.html')
+parser.add_option('-o', '--output-type', dest='output_type',
+ help='Type of output (filename | date)',
+ default='filename')
+(options, args) = parser.parse_args()
+
+