base.py 文件源码

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

项目:dodo_commands 作者: mnieber 项目源码 文件源码
def create_parser(self, prog_name, subcommand):  # noqa
        """
        Create and return the ``ArgumentParser`` which will be used to
        parse the arguments to this command.
        """
        parser = CommandParser(
            self, prog="%s %s" % (os.path.basename(prog_name), subcommand),
            description=self.help or None)
        parser.add_argument(
            '--traceback', action='store_true',
            help=SUPPRESS)
        if self.args:
            # Keep compatibility and always accept positional arguments,
            # like optparse when args is set
            parser.add_argument('args', nargs='*')
        self.add_arguments(parser)
        argcomplete.autocomplete(parser)

        return parser
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号