Help text fixes.

This commit is contained in:
Bastian Kleineidam 2013-04-29 07:36:08 +02:00
parent 80d7defcd2
commit 624e640ed3

17
dosage
View file

@ -155,15 +155,16 @@ def saveComicStrip(strip, basepath, dryrun):
return errors, allskipped return errors, allskipped
def displayHelp(comics): def displayHelp(options):
"""Print help for comic strips.""" """Print help for comic strips."""
errors = 0
try: try:
for scraperobj in getScrapers(comics): for scraperobj in getScrapers(options.comic, options.basepath):
displayComicHelp(scraperobj) errors += displayComicHelp(scraperobj)
except ValueError as msg: except ValueError as msg:
out.exception(msg) out.exception(msg)
return 1 return 2
return 0 return errors
def displayComicHelp(scraperobj): def displayComicHelp(scraperobj):
@ -178,6 +179,10 @@ def displayComicHelp(scraperobj):
if scraperobj.help: if scraperobj.help:
for line in scraperobj.help.splitlines(): for line in scraperobj.help.splitlines():
out.info(line) out.info(line)
return 0
except ValueError as msg:
out.exception(msg)
return 1
finally: finally:
out.context = '' out.context = ''
@ -275,7 +280,7 @@ def run(options):
out.warn('No comics specified, bailing out!') out.warn('No comics specified, bailing out!')
return 1 return 1
if options.modulehelp: if options.modulehelp:
return displayHelp(options.comic) return displayHelp(options)
return getComics(options) return getComics(options)