#!/usr/bin/env python

import logging
logging.basicConfig(level=logging.INFO, format='%(message)s')

import os
import sys
sys.path.extend([os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')])

# Fixes issue with werkzeug and PyInstaller.
import werkzeug

# Fixes issue with simplejson and PyInstaller.
import json
sys.modules['simplejson'] = json

import multiprocessing
from google.apputils import appcommands
from grow.common import sdk_utils
from grow import commands

# This hack displays useful information at the top of the "grow help" command.
_text = ('The Grow SDK: a declarative, file-based CMS for building high-quality web sites.'
         '\n\nVersion: {}. See documentation at: http://growsdk.org.')
__doc__ = _text.format(sdk_utils.get_this_version())


def main(argv):
  commands.add_commands()


if __name__ == '__main__':
  multiprocessing.freeze_support()
  appcommands.Run()
