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.')
|
||||
parser.add_argument('-s', '--settings', dest='settings',
|
||||
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__':
|
||||
args = parser.parse_args()
|
||||
files = []
|
||||
try:
|
||||
generate_output(args.path, args.templates, args.output, args.markup,
|
||||
args.settings)
|
||||
print 'Done !'
|
||||
except Exception, e:
|
||||
print 'Error ! %s' % e
|
||||
if args.debug:
|
||||
run(args)
|
||||
else:
|
||||
try:
|
||||
run(args)
|
||||
except Exception, e:
|
||||
if args.debug:
|
||||
raise e
|
||||
else:
|
||||
print 'Error ! %s' % e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue