Skip to content

Improve help text and error reporting for pub upgrade target constraints - #4909

Merged
sigurdm merged 2 commits into
dart-lang:mainfrom
sigurdm:upgrade-constraint-syntax
Sep 10, 2026
Merged

Improve help text and error reporting for pub upgrade target constraints#4909
sigurdm merged 2 commits into
dart-lang:mainfrom
sigurdm:upgrade-constraint-syntax

Conversation

@sigurdm

@sigurdm sigurdm commented Sep 10, 2026

Copy link
Copy Markdown
Contributor
  • Provide concrete examples in pub upgrade --help illustrating valid target formats and upgrading multiple dependencies in a single command (dart pub upgrade foo bar, dart pub upgrade foo 'bar@^2.0.0').
  • Clarify that constraints follow standard pubspec.yaml syntax and note the need to quote constraints containing <, >, or spaces.
  • Clarify the argumentsDescription placeholder as [<package>[@<constraint>|@latest|@resolvable] ...].
  • Surface detailed FormatException messages with syntax hints when target constraints fail to parse.

Fixes #4896

…aints

- Add concrete examples to `pub upgrade --help` illustrating valid target formats.
- Clarify that constraints follow standard pubspec.yaml syntax and note quoting requirements for shells.
- Change argumentsDescription placeholder from `dependencies` to `<package>`.
- Surface detailed FormatException messages with syntax hints when target constraints fail to parse.

Fixes dart-lang#4896
@sigurdm
sigurdm marked this pull request as ready for review September 10, 2026 09:51
@sigurdm
sigurdm requested a review from mosuem September 10, 2026 09:51
@sigurdm
sigurdm merged commit 6c723a4 into dart-lang:main Sep 10, 2026
29 checks passed
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.

How does the user learn the syntax for the <constraint>?

2 participants