def add_argument(parser, dest, info):
    """ Add an argument to an `argparse.ArgumentParser` object

    Parameters
    ----------
    parser : `argparse.ArgumentParser`
        The parser in question

    dest : str
        The destination for the argument

    info : `tuple`
        The information associated with the argument in question.

    """
    default, helpstr, typeinfo = info

    if dest == 'args':
        parser.add_argument('args', nargs='+', default=None, help=helpstr)
    elif typeinfo == list:
        parser.add_argument('--%s' % dest, action='append', help=helpstr)
    elif typeinfo == bool:
        parser.add_argument('--%s' % dest, action='store_true', help=helpstr)
    else:
        parser.add_argument('--%s' % dest, action='store', type=typeinfo,
                            default=default, help=helpstr)
def add_argument ( parser , dest , info ) : default , helpstr , typeinfo = info if dest == 'args' : parser . add_argument ( 'args' , nargs = '+' , default = None , help = helpstr ) elif typeinfo == list : parser . add_argument ( '--%s' % dest , action = 'append' , help = helpstr ) elif typeinfo == bool : parser . add_argument ( '--%s' % dest , action = 'store_true' , help = helpstr ) else : parser . add_argument ( '--%s' % dest , action = 'store' , type = typeinfo , default = default , help = helpstr )
Add an argument to an `argparse.ArgumentParser` object

    Parameters
    ----------
    parser : `argparse.ArgumentParser`
        The parser in question

    dest : str
        The destination for the argument

    info : `tuple`
        The information associated with the argument in question.