code: def create_parser(self, prog_name, subcommand):
          
          parser = optparse.OptionParser(
              prog=prog_name,
              usage=self.usage(subcommand),
              version=self.get_version(),
              option_list=self.get_option_list())
          for name, description, option_list in self.get_option_groups():
              group = optparse.OptionGroup(parser, name, description);
              list(map(group.add_option, option_list))
              parser.add_option_group(group)
          return parser
docs: Customize the parser to include option groups.