@command(short_help='Spawns a shell within the virtualenv.', context_settings=dict(ignore_unknown_options=True, allow_extra_args=True))
@option('--three/--two', is_flag=True, default=None, help='Use Python 3/2 when creating virtualenv.')
@option('--python', default=False, nargs=1, callback=validate_python_path, help='Specify which version of Python virtualenv should use.')
@option('--fancy', is_flag=True, default=False, help='Run in shell in fancy mode (for elegantly configured shells).')
@option('--anyway', is_flag=True, default=False, help='Always spawn a subshell, even if one is already spawned.')
@argument('shell_args', nargs=(- 1))
def shell(three=None, python=False, fancy=False, shell_args=None, anyway=False):
    from .core import load_dot_env, do_shell
    if ('PIPENV_ACTIVE' in os.environ):
        venv_name = os.environ.get('VIRTUAL_ENV', 'UNKNOWN_VIRTUAL_ENVIRONMENT')
        if (not anyway):
            echo('{0} {1} {2}\nNo action taken to avoid nested environments.'.format(crayons.normal('Shell for'), crayons.green(venv_name, bold=True), crayons.normal('already activated.', bold=True)), err=True)
            sys.exit(1)
    load_dot_env()
    if (os.name == 'nt'):
        fancy = True
    do_shell(three=three, python=python, fancy=fancy, shell_args=shell_args)
@command(short_help='Spawns a shell within the virtualenv.', context_settings=dict(ignore_unknown_options=True, allow_extra_args=True))
@option('--three/--two', is_flag=True, default=None, help='Use Python 3/2 when creating virtualenv.')
@option('--python', default=False, nargs=1, callback=validate_python_path, help='Specify which version of Python virtualenv should use.')
@option('--fancy', is_flag=True, default=False, help='Run in shell in fancy mode (for elegantly configured shells).')
@option('--anyway', is_flag=True, default=False, help='Always spawn a subshell, even if one is already spawned.')
@argument('shell_args', nargs=(- 1))
def shell(three=None, python=False, fancy=False, shell_args=None, anyway=False):
    from .core import load_dot_env, do_shell
    if ('PIPENV_ACTIVE' in os.environ):
        venv_name = os.environ.get('VIRTUAL_ENV', 'UNKNOWN_VIRTUAL_ENVIRONMENT')
        if (not anyway):
            echo('{0} {1} {2}\nNo action taken to avoid nested environments.'.format(crayons.normal('Shell for'), crayons.green(venv_name, bold=True), crayons.normal('already activated.', bold=True)), err=True)
            sys.exit(1)
    load_dot_env()
    if (os.name == 'nt'):
        fancy = True
    do_shell(three=three, python=python, fancy=fancy, shell_args=shell_args)