Make Mill commands require named CLI parameters by default #3431
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This aligns the semantics with MainArgs library defaults. Previously we grandfathered in the "positional by default" behavior because Mill pre-dates mainargs, with original behavior inherited from Ammonite. But most CLIs do not allow keyword args to be naively replaced by positional args, and MainArgs thus chose to have such behavior as opt-in. Mill should follow suite
Added a flag
--allow-positional-command-args
to fall back to the old behavior, and covered this behavior with example tests, docs, and updated the changelog.This is a binary-compatible but semantically-incompatible change, so it should go into 0.12.0. It's a pretty painful breaking change, but it's definitely the right thing to do long term, so better to get it over with. People can also add
--allow-positional-command-args
to their./mill
file if they want to preserve the old behavior in perpetuity