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 af1282b0a1..02bd5dc90f 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -596,6 +596,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 b23534d635..422e8ea3cc 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2582,7 +2582,8 @@ def do_sync( deploy=deploy, system=system, ) - click.echo(crayons.green("All dependencies are now up-to-date!")) + 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): @@ -2611,14 +2612,14 @@ 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( - fix_utf8("Uninstalling {0}…".format(repr(apparent_bad_package))), bold=True + if not bare: + click.echo( + crayons.white( + fix_utf8("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)