Skip to content

Fix --help hiding most CLI options in diff-cover/diff-quality#599

Merged
Bachmann1234 merged 1 commit into
Bachmann1234:mainfrom
duxiaocheng:fix-help-output
May 23, 2026
Merged

Fix --help hiding most CLI options in diff-cover/diff-quality#599
Bachmann1234 merged 1 commit into
Bachmann1234:mainfrom
duxiaocheng:fix-help-output

Conversation

@duxiaocheng
Copy link
Copy Markdown
Contributor

The deprecated-flag pre-parser in handle_old_format() was created with the default add_help=True, so argparse intercepted --help there and printed help for the 4-option pre-parser instead of the real one. As a result, users saw only --html-report/--json-report/--markdown-report/ --format and assumed flags like --diff-file, --compare-branch, --exclude, etc. didn't exist.

Setting add_help=False on the pre-parser lets --help fall through to parse_coverage_args (and the equivalent diff-quality parser), so the full set of options is displayed.

The deprecated-flag pre-parser in handle_old_format() was created
with the default add_help=True, so argparse intercepted --help there
and printed help for the 4-option pre-parser instead of the real one.
As a result, users saw only --html-report/--json-report/--markdown-report/
--format and assumed flags like --diff-file, --compare-branch, --exclude,
etc. didn't exist.

Setting add_help=False on the pre-parser lets --help fall through to
parse_coverage_args (and the equivalent diff-quality parser), so the
full set of options is displayed.
@Bachmann1234
Copy link
Copy Markdown
Owner

Thanks! I'll get this out this weekend!

@Bachmann1234 Bachmann1234 merged commit eebdd2a into Bachmann1234:main May 23, 2026
14 checks passed
@Bachmann1234
Copy link
Copy Markdown
Owner

@duxiaocheng thanks! This is released https://pypi.org/project/diff-cover/10.2.1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants