Skip to content

Conversation

Kissaki
Copy link
Contributor

@Kissaki Kissaki commented Apr 20, 2025

by dropping output parsing of non-stable unstructured output into structured output.


winget-completions.nu defines more than custom completions: it defines parsing for winget show, winget source list, winget search, winget list.

winget show shows different user messages and rendered manifest information.

#825 reports winget show breakage for winget show for packages carapace, Peppy.Osu!, flux.flux.

The source yaml (for example rsteube.Carapace.locale.en-US.yaml) is in YAML format. The command implementation tries to parse the rendered output and transform it into yaml, but fails to do so. The logic is quite complicated and error prone, with no guarantees on winget show output stability in text or format.

Rather than trying to this the script, it seems safer to drop parsing the output into a structure format. #825 indicates winget show has been broken for a year.

If we want to support structured output from winget show, it would be preferable to depend on winget show offering a structured output option (which it currently does not offer), or at least not offer error-prone parsing as a default part of custom completions. Users can still parse the output themselves. Independent of this removal, users may suggest alternative less error-prone or custom-completion-breaking approaches.

Resolves #825

BREAKING: Drops structured output from winget show

by dropping output parsing of non-stable unstructured output into structured output.

---

winget-completions.nu defines more than custom completions: it defines parsing for `winget show`, `winget source list`, `winget search`, `winget list`.

`winget show` shows different user messages and rendered manifest information.

nushell#825 reports winget show breakage for `winget show` for packages `carapace`, `Peppy.Osu!`, `flux.flux`.

The source yaml (for example [rsteube.Carapace.locale.en-US.yaml][sourceyaml]) is in YAML format. The command implementation tries to parse the rendered output and transform it into yaml, but fails to do so. The logic is quite complicated and error prone, with no guarantees on `winget show` output stability in text or format.

Rather than trying to this the script, it seems safer to drop parsing the output into a structure format. nushell#825 indicates winget show has been broken for a year.

If we want to support structured output from `winget show`, it would be preferable to depend on `winget show` offering a structured output option (which it currently does not offer), or at least not offer error-prone parsing as a default part of *custom completions*.
Users can still parse the output themselves. Independent of this removal, users may suggest alternative less error-prone or custom-completion-breaking approaches.

[sourceyaml]: https://github.com/microsoft/winget-pkgs/blob/2ec31577c47a3c9fb141a2b6ef3113333ccef00f/manifests/r/rsteube/Carapace/1.3.0/rsteube.Carapace.locale.en-US.yaml

Resolves nushell#825

BREAKING: Drops structured output from `winget show`
@fdncred fdncred merged commit 959c429 into nushell:main Apr 20, 2025
1 check passed
@fdncred
Copy link
Contributor

fdncred commented Apr 20, 2025

Thanks

@Kissaki Kissaki deleted the fix/wingetshow branch April 21, 2025 08:46
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.

'winget show' errors on specific packages
2 participants