def get_args():
    """Parse command line arguments
    """
    desc = 'Perform queries against the NCBI Taxa database'
    epi = """DESCRIPTION:
    This script lets you find out what TaxIDs to pass to ngd, and will write 
    a simple one-item-per-line file to pass in to it. It utilises the ete3 
    toolkit, so refer to their site to install the dependency if it's not 
    already satisfied.

    You can query the database using a particular TaxID, or a scientific name. 
    The primary function of the script is to return all the child taxa of the
    specified parent taxa. If specified with -v verbose flags however, the
    script will also print out some information about the lineages etc.
 
    WARNING: This script is still somewhat experimental
    """
    parser = argparse.ArgumentParser(description=desc, epilog=epi,
                                     formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument('taxid', metavar='taxid', type=str,
			help='A comma-separated list of TaxIDs and/or taxon names. (e.g. 561,2172)')   
    parser.add_argument('-v', '--verbose', action='count', default=0,
			help='Verbose behaviour. Supports 3 levels at present: Off = 0, Info = 1, Verbose = 2. (default: %(default)s)')
    parser.add_argument('-d', '--database', type=str, default=None,
			help='NCBI taxonomy database file path. If "None", it will be downloaded (default: %(default)s)')
    parser.add_argument('-u', '--update', action='store_true', default=False,
                        help='Update the local taxon database before querying. Recommended if not used for a while. (default: %(default)s)')
    parser.add_argument('-j', '--just-taxids', action='store_true', default=False,
                        help='Just write out a list of taxids an no other information (default: %(default)s)')
    parser.add_argument('-i', '--taxon-info', action='store_true', default=False,
                        help='Just write out rank & lineage info on the provided taxids (default: %(default)s)')
    parser.add_argument('-o', '--outfile', action='store',
			help='Output file to store the descendent TaxIDs for the query.')
    return parser.parse_args()
Parse command line arguments