<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_parser(parser, subparsers_action=None, categories=('other', ), add_help=True):
 """Attaches `parser` to the global ``parser_map``. If `add_help` is truthy, each category in `categories`. :param subparsers_action: A special action object that is returned by :type subparsers_action: argparse._SubParsersAction, or None. """

    name = re.sub('^dx ', '', parser.prog)
    if subparsers_action is None:
        subparsers_action = subparsers
    if isinstance(categories, basestring):
        categories = (categories, )

    parser_map[name] = parser
    if add_help:
        _help = subparsers_action._choices_actions[-1].help
        parser_categories['all']['cmds'].append((name, _help))
        for category in categories:
            parser_categories[category]['cmds'].append((name, _help))