def create_parser():
"""Creat a commandline parser for epubcheck
:return Argumentparser:
"""
parser = ArgumentParser(
prog='epubcheck',
description="EpubCheck v%s - Validate your ebooks" % __version__
)
# Arguments
parser.add_argument(
'path',
nargs='?',
default=getcwd(),
help="Path to EPUB-file or folder for batch validation. "
"The current directory will be processed if this argument "
"is not specified."
)
# Options
parser.add_argument(
'-x', '--xls', nargs='?', type=FileType(mode='wb'),
const='epubcheck_report.xls',
help='Create a detailed Excel report.'
)
parser.add_argument(
'-c', '--csv', nargs='?', type=FileType(mode='wb'),
const='epubcheck_report.csv',
help='Create a CSV report.'
)
parser.add_argument(
'-r', '--recursive', action='store_true',
help='Recurse into subfolders.'
)
return parser
评论列表
文章目录