mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-03 07:37:16 -04:00
Fixed completions not generating
Former-commit-id: 3f8c64047f12456fd3c1ce8243293beb323912a2 [formerly 915a17b8e9]
Former-commit-id: 0e322f3cda6e75f2db8b9e649028fccbf1ae09ad
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
_path_gen() {
|
_path_gen() {
|
||||||
local sshyp_path="$HOME/.local/share/sshyp/"
|
local sshyp_path="$HOME/.local/share/sshyp"
|
||||||
local sshyp_path_length="${#sshyp_path}"
|
local sshyp_path_length="$(("${#sshyp_path}" + 1))"
|
||||||
readarray -t full_paths < <(find "$HOME"/.local/share/sshyp -type f -exec ls {} \;)
|
readarray -t full_paths < <(find "$sshyp_path" -type f -exec ls {} \;)
|
||||||
for path in "${full_paths[@]}"; do
|
for path in "${full_paths[@]}"; do
|
||||||
trimmed_path=$(echo $path | sed 's/.\{4\}$//' | cut -c"$sshyp_path_length"-)
|
trimmed_path=$(echo $path | sed 's/.\{4\}$//' | cut -c"$sshyp_path_length"-)
|
||||||
trimmed_path=$(echo ${trimmed_path// /\\ })
|
trimmed_path=$(echo ${trimmed_path// /\\ })
|
||||||
@@ -47,4 +47,4 @@ _sshyp_completions() {
|
|||||||
|
|
||||||
esac
|
esac
|
||||||
} &&
|
} &&
|
||||||
complete -F _sshyp_completions sshyp
|
_path_gen && complete -F _sshyp_completions sshyp
|
||||||
|
|||||||
Reference in New Issue
Block a user