#! /usr/bin/env python

# This code is duplicated in bin/cnd and bin/cndcc.
# Make sure to change both copies.

try:
    import cnd
except ImportError:
    import sys

    from os.path import dirname, join
    from os import getcwd
    dist_dir = dirname(dirname(sys.argv[0]))
    if not dist_dir:
        dist_dir = dirname(getcwd())

    sys.path.extend([
            dist_dir,
            join(dist_dir, "pycparser-shipped"),
            join(dist_dir, "ply-shipped"),
            ])

    import cnd

cnd.run_standalone()
