Use globbing to generate entry list for shell completion (faster)

Former-commit-id: ea8212223896fc86368f772f43053f6ee8742068
Former-commit-id: 5f35b58014dcc00cb733d4980e28157e4de1ffcb
This commit is contained in:
2023-03-08 16:19:02 -05:00
parent 4f409f62d6
commit 843dff6527
+1 -1
View File
@@ -3,7 +3,7 @@
_path_gen() {
local sshyp_path="$HOME/.local/share/sshyp"
local sshyp_path_length="$(("${#sshyp_path}" + 1))"
mapfile -t full_paths < <(find "$sshyp_path" -type f -exec ls {} \;)
full_paths=(~/.local/share/sshyp/**/*.gpg)
for path in "${full_paths[@]}"; do
trimmed_path=$(echo ${path%????} | cut -c"$sshyp_path_length"-)
trimmed_paths+=("$trimmed_path")