From 843dff6527ea800a6606698156905974d5f6d4da Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Wed, 8 Mar 2023 16:19:02 -0500 Subject: [PATCH] Use globbing to generate entry list for shell completion (faster) Former-commit-id: ea8212223896fc86368f772f43053f6ee8742068 Former-commit-id: 5f35b58014dcc00cb733d4980e28157e4de1ffcb --- extra/sshyp-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/sshyp-completion.bash b/extra/sshyp-completion.bash index aef9107..f33c9cc 100755 --- a/extra/sshyp-completion.bash +++ b/extra/sshyp-completion.bash @@ -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")