completions/flatpak: Fix broken cache usage

This can't work because __fish_cached calls out to /bin/sh for fairly dubious reasons,
and it tries to get it to run a function.

So just run the *command* that the function runs and do the added filtering outside.
This commit is contained in:
Fabian Boehm
2026-01-21 17:31:20 +01:00
parent 1d2a5997cc
commit 8bf416cd64

View File

@@ -63,7 +63,7 @@ complete -f -c flatpak -n "__fish_seen_subcommand_from info uninstall" -a "(__fi
complete -f -c flatpak -n "__fish_seen_subcommand_from enter kill" -a "(__fish_flatpak ps --columns=instance,application)"
complete -f -c flatpak -n "__fish_seen_subcommand_from remote-info remote-ls remote-modify remote-delete" -a "(__fish_flatpak remotes --columns=name,title)"
complete -c flatpak -n '__fish_seen_subcommand_from install' -xa "(__fish_cached -t 250 -- '__fish_flatpak remote-ls --columns=application,name')"
complete -c flatpak -n '__fish_seen_subcommand_from install' -xa "(__fish_cached -t 250 -- 'flatpak remote-ls --columns=application,name' | string replace -rf '^([^A-Z].*?)(?: +|\t)(.*?)\s*\$' '\$1\t\$2')"
# Plenty of the other stuff is too free-form to complete (e.g. remote-add).
complete -f -c flatpak -s h -l help