adapter.py 文件源码

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

项目:apimas 作者: grnet 项目源码 文件源码
def _add_format_option(self, command, action):
        """
        Add format option.

        This option defines the format type of the command output. This
        option is attached only on `ListCommand` and `RetrieveCommand`.

        :param command: Command instance.
        :param action: Action type, e.g. 'list', 'retrieve', etc.
        """
        if action in self.READ_ACTIONS:
            return click.option(
                '--format', type=click.Choice(['json', 'table']),
                default='json')(command)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号