From 3c89e9d88d21d6ea171889989008172b53262e67 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 12 Jul 2023 11:50:34 +0200 Subject: [PATCH] Fixed qp set_file --- etc/qp.rc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/etc/qp.rc b/etc/qp.rc index 9eec4570..c485abea 100644 --- a/etc/qp.rc +++ b/etc/qp.rc @@ -188,7 +188,19 @@ _qp_Complete() ;; esac;; set_file) - COMPREPLY=( $(compgen -W "$(for i in */ $(find . -name ezfio | sed 's/ezfio$/.version/') ; do [[ -f $i ]] && echo ${i%/.version} ; done)" -- ${cur} ) ) + # Array to store directory names + dirs=() + + # Find directories containing "ezfio/.version" file recursively + for i in $(find . -name ezfio | sed 's/ezfio$/.version/') + do + dir_name=${i%/.version} # Remove the ".version" suffix + dir_name=${dir_name#./} # Remove the leading "./" if present + dirs+=("$dir_name") + done + + # Output the directory names for completion + COMPREPLY=("${dirs[@]/#/.\/}") # Prefix each directory name with "./" return 0 ;; plugins)