def METHOD_NAME():
    if len(sys.argv) == 2:
        out = sys.argv[1]
    elif len(sys.argv) == 1:
        out = os.curdir
    else:
        sys.stderr.write('Usage: %s [output directory]\n' % sys.argv[0])
        return -1
    # Tweak options to hide the title we don't need.
    options = {
        'raildraw_title_hide':True,
        'raildraw_title_after':0,
    }
    # Dump each diagram as a PNG.
    for d in DIAGRAMS:
        path = os.path.join(out, '%s.png' % list(d.keys())[0])
        draw_to_png(d, options, path, True)
    return 0