Fix winget-completions breaking winget show #1090
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 packagescarapace
,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 onwinget 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