mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add a --debug option.
This commit is contained in:
parent
dbe4229e5e
commit
3d7a10a298
1 changed files with 18 additions and 6 deletions
24
bin/pelican
24
bin/pelican
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue