Skip to content

Commit

Permalink
Display non-default debris values in help screen
Browse files Browse the repository at this point in the history
  • Loading branch information
bittner committed Sep 20, 2023
1 parent 5b25a89 commit b61ef94
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyclean/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ def parse_arguments():
nargs='*', default=argparse.SUPPRESS, choices=debris_choices,
help='remove leftovers from popular Python development '
'tools (may be specified multiple times; '
'default: %s)' % ' '.join(debris_default_topics))
'optional: all %s; default: %s)' % (
' '.join(debris_optional_topics),
' '.join(debris_default_topics),
),
)
parser.add_argument('-e', '--erase', metavar='PATTERN', action='extend',
nargs='+', default=[],
help='delete files or folders matching a globbing '
Expand Down
15 changes: 15 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,21 @@ def test_debris_default_args():
assert args.debris == ['cache', 'coverage', 'package', 'pytest']


def test_debris_optional_args():
"""
Does the help screen explain all --debris options?
"""
expected_debris_options_help = (
'(may be specified multiple times; '
'optional: all jupyter mypy ruff tox; '
'default: cache coverage package pytest)'
)

result = shell('pyclean --help')

assert expected_debris_options_help in result.stdout


def test_debris_all():
"""
Does calling `pyclean --debris all` pick all topics?
Expand Down

0 comments on commit b61ef94

Please sign in to comment.