From 9d9758c36dbfcad61a9a850f8a4b1e7dc6306141 Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Thu, 3 May 2018 16:05:07 -0700 Subject: completion: Only show files with the correct prefix Currently flatpak's bash completion is a bit broken. It shows all files with the appropriate extension (.flatpak or .flatpakref) rather than just the ones starting with the characters you've already typed. So this commit fixes that behavior by using the -X compgen option rather than -G. For example, here's the old behavior: $ flatpak install e bijiben.flatpak eos eos-runtimes builder.flatpak eos-apps eos-sdk and here's the new behavior: $ flatpak install e eos eos-apps eos-runtimes eos-sdk $ flatpak install b bijiben.flatpak builder.flatpak Closes: #1645 Approved by: alexlarsson --- completion/flatpak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'completion') diff --git a/completion/flatpak b/completion/flatpak index b90ef092..08f7353f 100755 --- a/completion/flatpak +++ b/completion/flatpak @@ -13,9 +13,9 @@ __flatpak() { if [[ "${RES[$i]}" = "__FLATPAK_FILE" ]]; then declare -a COMPGEN_OPTS=('-f') elif [[ "${RES[$i]}" = "__FLATPAK_BUNDLE_FILE" ]]; then - declare -a COMPGEN_OPTS=('-f' '-G' '*.flatpak') + declare -a COMPGEN_OPTS=('-f' '-X' '!*.flatpak') elif [[ "${RES[$i]}" = "__FLATPAK_BUNDLE_OR_REF_FILE" ]]; then - declare -a COMPGEN_OPTS=('-f' '-G' '*.flatpak@(|ref)') + declare -a COMPGEN_OPTS=('-f' '-X' '!*.flatpak@(|ref)') elif [[ "${RES[$i]}" = "__FLATPAK_DIR" ]]; then declare -a COMPGEN_OPTS=('-d') else -- cgit v1.2.1