This function sets up a command-line option parser and then calls fetch_and_write_mrca
    to do all of the real work.

def main(argv):
    """This function sets up a command-line option parser and then calls fetch_and_write_mrca
    to do all of the real work.
    """
    import argparse
    description = 'Uses Open Tree of Life web services to the MRCA for a set of OTT IDs.'
    parser = argparse.ArgumentParser(prog='ot-tree-of-life-mrca', description=description)
    parser.add_argument('ottid', nargs='*', type=int, help='OTT IDs')
    parser.add_argument('--subtree', action='store_true', default=False, required=False,
                        help='write a newick representation of the subtree rooted at this mrca')
    parser.add_argument('--induced-subtree', action='store_true', default=False, required=False,
                        help='write a newick representation of the topology of the requested taxa in the synthetic tree (the subtree pruned to just the queried taxa)')
    parser.add_argument('--details', action='store_true', default=False, required=False,
                        help='report more details about the mrca node')
    args = parser.parse_args(argv)
    id_list = args.ottid
    if not id_list:
        sys.stderr.write('No OTT IDs provided. Running a dummy query with 770302 770315\n')
        id_list = [770302, 770315]
    fetch_and_write_mrca(id_list, args.details, args.subtree, args.induced_subtree, sys.stdout, sys.stderr)