Skip to content

Commit

Permalink
Swapped argparse module for optparse module
Browse files Browse the repository at this point in the history
To lower the minimum python requirements the argparse module (2.7+)
is swapped for the optparse module.
  • Loading branch information
mattijs committed Feb 17, 2012
1 parent b9e3053 commit aaefe4f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bin/d
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

import sys, os, argparse
import sys, os, optparse

# Ugly hack so I can code in peace.
try:
Expand All @@ -11,12 +11,12 @@ except ImportError:

if __name__ == '__main__':

# Argument parser
parser = argparse.ArgumentParser(description='Markdown files to documentation. Run and get on with your life.')
parser.add_argument('-s', dest='source', default='.', help='Documentation source', metavar='SOURCE')
parser.add_argument('-t', dest='target', default='./build', help='Documentation output target', metavar='TARGET')
# Option parser
parser = optparse.OptionParser(description='Markdown files to documentation. Run and get on with your life.')
parser.add_option('-s', dest='source', default='.', help='Documentation source', metavar='SOURCE')
parser.add_option('-t', dest='target', default='./build', help='Documentation output target', metavar='TARGET')

args = parser.parse_args()
(options, args) = parser.parse_args()

# Render with arguments
render_files(args.source, args.target)
render_files(options.source, options.target)

0 comments on commit aaefe4f

Please sign in to comment.