cmdline.py 文件源码

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

项目:Hawkeye 作者: tozhengxq 项目源码 文件源码
def help(self, error=None, topic=None, parser=None):
        """Display an error message, or the named topic."""
        assert error or topic or parser
        if error:
            print(error)
            print("Use '%s help' for help." % (self.program_name,))
        elif parser:
            print(parser.format_help().strip())
        else:
            help_params = dict(self.covpkg.__dict__)
            help_params['program_name'] = self.program_name
            help_msg = textwrap.dedent(HELP_TOPICS.get(topic, '')).strip()
            if help_msg:
                print(help_msg % help_params)
            else:
                print("Don't know topic %r" % topic)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号