def build_options(func):
"""Add "build" Click options to function.
:param function func: The function to wrap.
:return: The wrapped function.
:rtype: function
"""
func = click.option('-a', '--banner-greatest-tag', is_flag=True,
help='Override banner-main-ref to be the tag with the highest version number.')(func)
func = click.option('-A', '--banner-recent-tag', is_flag=True,
help='Override banner-main-ref to be the most recent committed tag.')(func)
func = click.option('-b', '--show-banner', help='Show a warning banner.', is_flag=True)(func)
func = click.option('-B', '--banner-main-ref',
help="Don't show banner on this ref and point banner URLs to this ref. Default master.")(func)
func = click.option('-i', '--invert', help='Invert/reverse order of versions.', is_flag=True)(func)
func = click.option('-p', '--priority', type=click.Choice(('branches', 'tags')),
help="Group these kinds of versions at the top (for themes that don't separate them).")(func)
func = click.option('-r', '--root-ref',
help='The branch/tag at the root of DESTINATION. Will also be in subdir. Default master.')(func)
func = click.option('-s', '--sort', multiple=True, type=click.Choice(('semver', 'alpha', 'time')),
help='Sort versions. Specify multiple times to sort equal values of one kind.')(func)
func = click.option('-t', '--greatest-tag', is_flag=True,
help='Override root-ref to be the tag with the highest version number.')(func)
func = click.option('-T', '--recent-tag', is_flag=True,
help='Override root-ref to be the most recent committed tag.')(func)
func = click.option('-w', '--whitelist-branches', multiple=True,
help='Whitelist branches that match the pattern. Can be specified more than once.')(func)
func = click.option('-W', '--whitelist-tags', multiple=True,
help='Whitelist tags that match the pattern. Can be specified more than once.')(func)
return func
评论列表
文章目录