From 0920dcf004828f24dc9cef97d953a4b6590db511 Mon Sep 17 00:00:00 2001 From: Randall Date: Mon, 5 Sep 2022 14:29:43 -0400 Subject: [PATCH] Fixed completions not generating Former-commit-id: 3f8c64047f12456fd3c1ce8243293beb323912a2 [formerly 915a17b8e92c180c1fd4eba937878d0519b2cbb0] Former-commit-id: 0e322f3cda6e75f2db8b9e649028fccbf1ae09ad --- extra/sshyp-completion.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extra/sshyp-completion.bash b/extra/sshyp-completion.bash index adbf803..4f93cd4 100755 --- a/extra/sshyp-completion.bash +++ b/extra/sshyp-completion.bash @@ -1,9 +1,9 @@ #!/usr/bin/env bash _path_gen() { - local sshyp_path="$HOME/.local/share/sshyp/" - local sshyp_path_length="${#sshyp_path}" - readarray -t full_paths < <(find "$HOME"/.local/share/sshyp -type f -exec ls {} \;) + local sshyp_path="$HOME/.local/share/sshyp" + local sshyp_path_length="$(("${#sshyp_path}" + 1))" + readarray -t full_paths < <(find "$sshyp_path" -type f -exec ls {} \;) for path in "${full_paths[@]}"; do trimmed_path=$(echo $path | sed 's/.\{4\}$//' | cut -c"$sshyp_path_length"-) trimmed_path=$(echo ${trimmed_path// /\\ }) @@ -47,4 +47,4 @@ _sshyp_completions() { esac } && -complete -F _sshyp_completions sshyp +_path_gen && complete -F _sshyp_completions sshyp