def register_sub_commands(self, parser):
sub_commands = self.get_sub_commands()<EOL>if sub_commands:<EOL><INDENT>sub_parsers = parser.add_subparsers(dest=self.sub_parser_dest_name)<EOL>for name, cls in sub_commands.items():<EOL><INDENT>cmd = cls(name)<EOL>sub_parser = sub_parsers.add_parser(name, help=name, description=cmd.get_help(), formatter_class=cmd.get_formatter_class())<EOL>cmd.add_args(sub_parser)<EOL>cmd.register_sub_commands(sub_parser)<EOL><DEDENT><DEDENT>
Add any sub commands to the argument parser.

:param parser: The argument parser object