#!@PYTHON@
# -*- python -*-
#
# Written by the Mit authors 2019-2020.
#
# This file is in the public domain.
#
# THIS PROGRAM IS PROVIDED AS IS, WITH NO WARRANTY. USE IS AT THE USER’S
# RISK.

import argparse
import subprocess


# Process command-line arguments
parser = argparse.ArgumentParser(
    prog='mit-shell',
    description='Run Mit in a Python REPL with debugging facilities.',
    formatter_class=argparse.RawDescriptionHelpFormatter
)
parser.add_argument(
    '--version',
    action='version',
    version='''\
%(prog)s @VERSION@
Copyright (c) Mit authors 2019-2020.
This program is in the public domain.'''
)
args = parser.parse_args()

# Run IPython
ipython_opts = '@IPYTHON_OPTS@'.split()
subprocess.run(['@IPYTHON@', '-i'] + ipython_opts + ['-c', 'from mit.globals import *'])
