Skip to content

Mention --replace instead of --in-place in the dry-run error - #1451

Open
rootkiller6788 wants to merge 1 commit into
google:masterfrom
rootkiller6788:fix-dry-run-replace-message
Open

Mention --replace instead of --in-place in the dry-run error#1451
rootkiller6788 wants to merge 1 commit into
google:masterfrom
rootkiller6788:fix-dry-run-replace-message

Conversation

@rootkiller6788

Copy link
Copy Markdown

--dry-run combined with in-place formatting fails with "cannot use --dry-run and --in-place at the same time", but --in-place isn't an option. The flag is -i/-r/-replace/--replace, so the error names something users never type.

Changed the message to reference --replace (the long form shown in --help) and extended CommandLineFlagsTest to trigger the error through the --replace --dry-run spelling as well as the -i -n shorthand.

mvn -pl core test -Dtest=CommandLineFlagsTest passes (8/8).

The in-place option is spelled -i/-r/-replace/--replace on the command
line; --in-place doesn't exist. The usage error for combining --dry-run
with in-place formatting named a flag users never type, which made the
message read like a bug. Point it at --replace (the long form listed in
the help text) and add a test that triggers the error through --replace
rather than only through the -i shorthand.
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.

1 participant