diff --git a/news/3041.feature b/news/3041.feature new file mode 100644 index 0000000000..79a1d5de17 --- /dev/null +++ b/news/3041.feature @@ -0,0 +1 @@ +--bare now has an effect on clean, and sync's bare option is now used to reduce output. diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 1ce9fee944..aeeeda31be 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -590,6 +590,7 @@ def sync( @cli.command(short_help="Uninstalls all packages not specified in Pipfile.lock.") +@option("--bare", is_flag=True, default=False, help="Minimal output.") @option("--dry-run", is_flag=True, default=False, help="Just output unneeded packages.") @verbose_option @three_option diff --git a/pipenv/core.py b/pipenv/core.py index ca37bd5c0c..a4f3e8920e 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2513,8 +2513,9 @@ def do_sync( deploy=deploy, system=system, ) - requirements_dir.cleanup() - click.echo(crayons.green("All dependencies are now up-to-date!")) + requirements_dir.cleanup() + if not bare: + click.echo(crayons.green("All dependencies are now up-to-date!")) def do_clean(ctx, three=None, python=None, dry_run=False, bare=False, pypi_mirror=None): @@ -2543,14 +2544,15 @@ def do_clean(ctx, three=None, python=None, dry_run=False, bare=False, pypi_mirro )] failure = False for apparent_bad_package in installed_package_names: - if dry_run: + if dry_run and not bare: click.echo(apparent_bad_package) else: - click.echo( - crayons.white( - "Uninstalling {0}…".format(repr(apparent_bad_package)), bold=True + if not bare: + click.echo( + crayons.white( + "Uninstalling {0}…".format(repr(apparent_bad_package)), bold=True + ) ) - ) # Uninstall the package. c = delegator.run( "{0} uninstall {1} -y".format(which_pip(), apparent_bad_package)