allow specify input file from commandline

This commit is contained in:
Elan Ruusamäe 2012-09-17 11:08:46 +02:00
parent 009ad4dba5
commit c9b5272239

View file

@ -34,6 +34,11 @@ formatter = Formatter(request)
if __name__ == "__main__":
# pages/playground\(2f\)SyntaxReference/revisions/00000001
with open('syntaxreference.txt', 'r') as f:
if len(sys.argv) > 1:
inputfile = sys.argv[1]
else:
inputfile = 'syntaxreference.txt'
with open(inputfile, 'r') as f:
text = f.read()
print moin2doku('test', text)