#!/usr/bin/env python
"""
ptpython: Interactive Python shell.
Usage:
    ptpython [ --vi ]
    ptpython -h | --help

Options:
    --vi      : Use Vi keybindings instead of Emacs bindings.
"""
import docopt

from prompt_toolkit.contrib.repl import embed

def _run_repl():
    a = docopt.docopt(__doc__)

    vi_mode = bool(a['--vi'])

    # Create globals/locals dict.
    globals_, locals_ = {}, {}

    # Run interactive shell.
    embed(globals_, locals_, vi_mode=vi_mode)

if __name__ == '__main__':
    _run_repl()
