#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
#           please also see AUTHORS file
# :copyright: (c) 2007-2013, The Tor Project, Inc.
#             (c) 2007-2013, all entities within the AUTHORS file
# :license: 3-clause BSD, see included LICENSE for information

from __future__ import print_function

import os.path
import sys

from os import getcwd

from bridgedb.Main import run
from bridgedb.parse.options import parseOptions


option = parseOptions()

if option.subCommand is not None:
    # Hack to set the PYTHONPATH:
    sys.path[:] = map(os.path.abspath, sys.path)
    sys.path.insert(0, os.path.abspath(getcwd()))
    sys.path.insert(0, os.path.abspath(os.path.join(getcwd(), '..')))

run(option)
