9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-21 11:03:29 +01:00

Fixed qp set_file

This commit is contained in:
Anthony Scemama 2023-07-12 11:50:34 +02:00
parent 1e390d8357
commit 3c89e9d88d

View File

@ -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)