Feature Request: Add option to filter winget upgrade for major version updates only
Description of the new feature / enhancement
Currently, the winget upgrade command lists all installed packages that have any available update (major, minor, or patch). This can result in a long list, making it difficult to quickly identify packages that have received a significant update, specifically a major version bump (e.g., from version 1.x.x to 2.x.x).
The problem is that users who want to prioritize or handle major updates differently (due to potential breaking changes or significant new features) have no built-in way to filter the winget upgrade output accordingly. Current workarounds involve manually inspecting the version numbers in the output or writing custom scripts to parse and filter the text output, which is cumbersome and less reliable.
This feature request proposes adding a new option or flag to the winget upgrade command that allows users to filter the list to show only those packages where the available update represents a major version increase compared to the currently installed version.
Describe why and how a user would use this new functionality (if applicable):
Why:
- Prioritization: Users could quickly identify and focus on major updates, which often require more attention, testing, or manual intervention than minor/patch updates.
- Risk Management: Major version updates are more likely to introduce breaking changes. Filtering allows users to isolate these potentially riskier updates for careful consideration or separate update schedules.
- Efficiency: Saves time by eliminating the need to manually scan through a potentially long list of minor/patch updates when only major changes are of interest.
- Automation: Enables scripting scenarios where major updates are handled differently (e.g., logged for manual review, applied in a specific maintenance window) compared to routine minor/patch updates.
How:
A user could invoke the command with a new flag, for example:
winget upgrade --major-only
The expected output would be a list similar to the standard winget upgrade output, but containing only the packages where the "Available" version number indicates a jump in the major version component compared to the installed "Version".
Example Scenario:
- Package A: Installed
1.5.2, Available2.0.0-> Shown in output - Package B: Installed
3.1.0, Available3.2.5-> Not shown in output - Package C: Installed
0.9.0, Available1.0.0-> Shown in output - Package D: Installed
4.0.1, Available4.0.2-> Not shown in output
This functionality would significantly improve the user experience for managing application updates, especially in environments where distinguishing between major and minor updates is important.
Proposed technical implementation details
No response
I think that this would be most useful when updating packages where the project respects semver.
But I can think of many projects which don't adhere to semver, and/or have differing ideas about what a "major" update would entail.
I believe there might be another ticket asking for similar functionality, except that it would be --minor-only, so that you could apply small security related updates, without imposing on users unexpected changes to how the respected packages are used.
Related to a similar request:
- https://github.com/microsoft/winget-cli/issues/1914
See also:
- https://github.com/microsoft/winget-cli/pull/4602
where it was suggested maybe having a syntax for it might be more appropriate to handle both requests