'Load a command table into our parser.'

def load_command_table(self, command_table):

    if (not self.subparsers):
        sp = self.add_subparsers(dest='_command_package')
        sp.required = True
        self.subparsers = {(): sp}
    for (command_name, metadata) in command_table.items():
        subparser = self._get_subparser(command_name.split())
        command_verb = command_name.split()[(-1)]
        subparser.choices[command_verb] = command_verb
        fc = (metadata.formatter_class or argparse.HelpFormatter)
        command_parser = subparser.add_parser(command_verb, description=metadata.description, parents=self.parents, conflict_handler='error', help_file=metadata.help, formatter_class=fc)
        argument_validators = []
        argument_groups = {}
        for arg in metadata.arguments.values():
            if arg.validator:
                argument_validators.append(arg.validator)
            if arg.arg_group:
                try:
                    group = argument_groups[arg.arg_group]
                except KeyError:
                    group_name = '{}    Arguments'.format(arg.arg_group)
                    group = command_parser.add_argument_group(arg.arg_group, group_name)
                    argument_groups[arg.arg_group] = group
                param = group.add_argument(*arg.options_list, **arg.options)
            else:
                try:
                    param = command_parser.add_argument(*arg.options_list, **arg.options)
                except argparse.ArgumentError:
                    dest = arg.options['dest']
                    if (dest in ['no_wait', 'raw']):
                        pass
                    else:
                        raise
            param.completer = arg.completer
        command_parser.set_defaults(func=metadata, command=command_name, _validators=argument_validators, _parser=command_parser)
