def add_cmd(self, name, help=None, func=None):
        """
        If func is None, this is regarded as a sub-parser which can contains
        sub-command.
        Else, this is a leaf node in cmd tree which can not add sub-command.
        :rtype: AParser
        """
        if self.subparsers is None:
            self.subparsers = self.add_subparsers(
                title="sub-commands",
                help=help or 'sub-commands',
            )

        parser = self.subparsers.add_parser(
            name,
            help=help,
        )
        if func is not None:
            parser.set_defaults(_func=func)
        return parser