def main():
    """ Main entry point """
    try:
        worktree = qisys.parsers.get_worktree({})
    except Exception as e:
        sys.stderr.write(str(e))
        sys.exit(2)
    if len(sys.argv) < 2:
        print(worktree.root)
        sys.exit(0)

    parser = argparse.ArgumentParser()
    parser.add_argument("token", nargs="?")
    parser.add_argument("-b", dest="build_name")
    args = parser.parse_args()
    path = None
    if args.build_name:
        try:
            path = get_qibuild_path(worktree, args.build_name)
        except qisys.worktree.NoSuchProject as e:
            sys.exit(str(e))
    else:
        token = sys.argv[1]
        path = find_best_match(worktree, token)
    if path:
        print(path)
        sys.exit(0)
    else:
        sys.stderr.write("no match for %s\n" % token)
        sys.exit(1)
dataset/ETHPy150Open aldebaran/qibuild/python/qicd.py/main/original