Skip to content

Conversation

Kissaki
Copy link
Contributor

@Kissaki Kissaki commented Oct 12, 2025

winget upgrade has two modes:

  • No parameters (at all) lists available upgrades
  • Any parameter attempts to match and upgrade a package

Much like winget list, winget upgrade prints a spinner, then a table, and then additionally a footer.

The winget list completions handle output through detect columns --guess and return structured data.

Presumably because detect columns --guess does not work on winget upgrade, no output handling was done until now.

  1. Split off trimLoadingSymbol as a common function between two, now three, commands
  2. Implement a separate command winget upgrades instead of handling winget upgrade because of overloaded behavior complicating implementation

Now, winget upgrades can be used to get structured data of available upgrades, while winget upgrade behaves like before, without parameters has text output, and with parameters upgrades packages.

While introducing a separate command is not strictly completions [for external commands], this one is very close to the completions, logic, and use cases. Keeping it close will help discovery and future development which may integrate returning structured data into the "normal" completions.


I was not able to test for “no updates” output.


winget upgrades
# => ╭───┬──────────────────────────────────┬─────────────────────┬───────────────────────────────┬───────────────────────────────┬────────╮
# => │ # │               name               │         id          │            version            │           available           │ source │
# => ├───┼──────────────────────────────────┼─────────────────────┼───────────────────────────────┼───────────────────────────────┼────────┤
# => │ 0 │ Go Programming Language amd64 g… │ GoLang.Go           │ 1.25.1                        │ 1.25.2                        │ winget │
# => ╰───┴──────────────────────────────────┴─────────────────────┴───────────────────────────────┴───────────────────────────────┴────────╯

`winget upgrade` has two modes:

* No parameters (at all) lists available upgrades
* Any parameter attempts to match and upgrade a package

Much like `winget list`, `winget upgrade` prints a spinner, then a table, and then additionally a footer.

The `winget list` completions handle output through `detect columns --guess` and return structured data.

Presumably because `detect columns --guess` does not work on `winget upgrade`, no output handling was done until now.

1. Split off trimLoadingSymbol as a common function between two, now three, commands
2. Implement a separate command `winget upgrades` instead of handling `winget upgrade` because of overloaded behavior complicating implementation

Now, `winget upgrades` can be used to get structured data of available upgrades, while `winget upgrade` behaves like before, without parameters has text output, and with parameters upgrades packages.

While introducing a separate command is not strictly completions [for external commands], this one is very close to the completions, logic, and use cases. Keeping it close will help discovery and future development which may integrate returning structured data into the "normal" completions.
untested, unverified
@fdncred
Copy link
Contributor

fdncred commented Oct 12, 2025

ok, thanks

@fdncred fdncred merged commit 766009a into nushell:main Oct 12, 2025
1 check passed
@Kissaki Kissaki deleted the feat/winget-upgrades branch October 13, 2025 15:50
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