Add a --debug option.

This commit is contained in:
Alexis Metaireau 2010-09-15 12:30:52 +02:00
commit 3d7a10a298

View file

@ -18,13 +18,25 @@ parser.add_argument('-m', '--markup', default='rst', dest='markup',
' available.') ' available.')
parser.add_argument('-s', '--settings', dest='settings', parser.add_argument('-s', '--settings', dest='settings',
help='the settings of the application. Default to None.') help='the settings of the application. Default to None.')
parser.add_argument('-b', '--debug', dest='debug', action='store_true')
def run(args):
generate_output(args.path, args.templates, args.output, args.markup,
args.settings)
print 'Done !'
if __name__ == '__main__': if __name__ == '__main__':
args = parser.parse_args() args = parser.parse_args()
files = [] files = []
try: if args.debug:
generate_output(args.path, args.templates, args.output, args.markup, run(args)
args.settings) else:
print 'Done !' try:
except Exception, e: run(args)
print 'Error ! %s' % e except Exception, e:
if args.debug:
raise e
else:
print 'Error ! %s' % e