mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #5966 from fmssn/enhancement-5954-reduce-notifications
Add quiet option to pipenv shell.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Add quiet option to pipenv shell, hiding "Launching subshell in virtual environment..."
|
||||
@@ -364,16 +364,14 @@ def lock(ctx, state, **kwargs):
|
||||
default=False,
|
||||
help="Always spawn a sub-shell, even if one is already spawned.",
|
||||
)
|
||||
@option(
|
||||
"--quiet", is_flag=True, help="Quiet standard output, except vulnerability report."
|
||||
)
|
||||
@argument("shell_args", nargs=-1)
|
||||
@pypi_mirror_option
|
||||
@python_option
|
||||
@pass_state
|
||||
def shell(
|
||||
state,
|
||||
fancy=False,
|
||||
shell_args=None,
|
||||
anyway=False,
|
||||
):
|
||||
def shell(state, fancy=False, shell_args=None, anyway=False, quiet=False):
|
||||
"""Spawns a shell within the virtualenv."""
|
||||
from pipenv.routines.shell import do_shell
|
||||
|
||||
@@ -399,6 +397,7 @@ def shell(
|
||||
fancy=fancy,
|
||||
shell_args=shell_args,
|
||||
pypi_mirror=state.pypi_mirror,
|
||||
quiet=quiet,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,9 @@ from pipenv.utils.shell import cmd_list_to_shell, system_which
|
||||
from pipenv.vendor import click
|
||||
|
||||
|
||||
def do_shell(project, python=False, fancy=False, shell_args=None, pypi_mirror=None):
|
||||
def do_shell(
|
||||
project, python=False, fancy=False, shell_args=None, pypi_mirror=None, quiet=False
|
||||
):
|
||||
# Ensure that virtualenv is available.
|
||||
ensure_project(
|
||||
project,
|
||||
@@ -25,7 +27,8 @@ def do_shell(project, python=False, fancy=False, shell_args=None, pypi_mirror=No
|
||||
from pipenv.shells import choose_shell
|
||||
|
||||
shell = choose_shell(project)
|
||||
click.echo("Launching subshell in virtual environment...", err=True)
|
||||
if not quiet:
|
||||
click.echo("Launching subshell in virtual environment...", err=True)
|
||||
|
||||
fork_args = (
|
||||
project.virtualenv_location,
|
||||
|
||||
Reference in New Issue
Block a user