def update_parser(parser, optlist=None, arglist=None):
    """Add given options and arguments to parser.
    """
    for shortopt, longopt, kwargs in optlist:
        parser.add_argument(shortopt, longopt, **kwargs)
    for argname, kwargs in arglist:
        parser.add_argument(argname, **kwargs)
