click_ext.py 文件源码

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

项目:configmanager 作者: jbasko 项目源码 文件源码
def argument(self, *args, **kwargs):
        """
        Registers a click.argument which falls back to a configmanager Item
        if user hasn't provided a value in the command line.

        Item must be the last of ``args``.
        """

        if kwargs.get('required', True):
            raise TypeError(
                'In click framework, arguments are mandatory, unless marked required=False. '
                'Attempt to use configmanager as a fallback provider suggests that this is an optional option, '
                'not a mandatory argument.'
            )

        args, kwargs = _config_parameter(args, kwargs)
        return self._click.argument(*args, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号