Commit 766009a
authored
Add
`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.
---
```nushell
winget upgrades
# => ╭───┬──────────────────────────────────┬─────────────────────┬───────────────────────────────┬───────────────────────────────┬────────╮
# => │ # │ name │ id │ version │ available │ source │
# => ├───┼──────────────────────────────────┼─────────────────────┼───────────────────────────────┼───────────────────────────────┼────────┤
# => │ 0 │ Go Programming Language amd64 g… │ GoLang.Go │ 1.25.1 │ 1.25.2 │ winget │
# => ╰───┴──────────────────────────────────┴─────────────────────┴───────────────────────────────┴───────────────────────────────┴────────╯
```winget upgrades command (#1179)1 parent cd81d16 commit 766009a
1 file changed
+35
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
262 | | - | |
263 | | - | |
| 266 | + | |
264 | 267 | | |
265 | 268 | | |
266 | 269 | | |
| |||
319 | 322 | | |
320 | 323 | | |
321 | 324 | | |
322 | | - | |
323 | | - | |
| 325 | + | |
324 | 326 | | |
325 | 327 | | |
326 | 328 | | |
| |||
338 | 340 | | |
339 | 341 | | |
340 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
341 | 372 | | |
342 | 373 | | |
343 | 374 | | |
| |||
0 commit comments