cli.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:srptools 作者: idlesign 项目源码 文件源码
def common_options(func):
    """Commonly used command options."""

    def parse_preset(ctx, param, value):
        return PRESETS.get(value, (None, None))

    def parse_private(ctx, param, value):
        return hex_from_b64(value) if value else None

    func = click.option('--private', default=None, help='Private.', callback=parse_private)(func)

    func = click.option(
        '--preset',
        default=None, help='Preset ID defining prime and generator pair.',
        type=click.Choice(PRESETS.keys()), callback=parse_preset
    )(func)

    return func
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号