mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-01 22:57:17 -04:00
Properly reset trimmed_paths for zsh completion
Former-commit-id: adda3df4ca4afbc7da162fb64592e853617802d4 Former-commit-id: 96917ce98bef0c879f392a2444f6d600589d9b53
This commit is contained in:
@@ -6,8 +6,8 @@ _path_gen() {
|
|||||||
[ -z "${glob_status##*u*}" ] && shopt -s globstar # if recursive globbing is disabled, enable it
|
[ -z "${glob_status##*u*}" ] && shopt -s globstar # if recursive globbing is disabled, enable it
|
||||||
local full_paths=("$sshyp_path"/**/*.gpg)
|
local full_paths=("$sshyp_path"/**/*.gpg)
|
||||||
$glob_status # set recursive globbing to user default
|
$glob_status # set recursive globbing to user default
|
||||||
for path in "${full_paths[@]}"; do
|
for scan_path in "${full_paths[@]}"; do
|
||||||
trimmed_paths+=("${path:${#sshyp_path}:-4}")
|
trimmed_paths+=("${scan_path:${#sshyp_path}:-4}")
|
||||||
done
|
done
|
||||||
if [ "${trimmed_paths[0]}" == '/**/*' ]; then trimmed_paths[0]=help; fi
|
if [ "${trimmed_paths[0]}" == '/**/*' ]; then trimmed_paths[0]=help; fi
|
||||||
} &&
|
} &&
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
|
|
||||||
sshyp_path="$HOME/.local/share/sshyp"
|
sshyp_path="$HOME/.local/share/sshyp"
|
||||||
full_paths=("$sshyp_path"/**/*.gpg)
|
full_paths=("$sshyp_path"/**/*.gpg)
|
||||||
|
trimmed_paths=()
|
||||||
for scan_path in "${full_paths[@]}"; do
|
for scan_path in "${full_paths[@]}"; do
|
||||||
trimmed_paths+=("${${scan_path#$sshyp_path}%????}")
|
trimmed_paths+=("${${scan_path#$sshyp_path}%????}")
|
||||||
done
|
done
|
||||||
[[ -v trimmed_paths ]] || trimmed_paths=(help)
|
[[ -z $trimmed_paths ]] && trimmed_paths=(help)
|
||||||
|
|
||||||
case ${words[-2]} in
|
case ${words[-2]} in
|
||||||
sshyp )
|
sshyp )
|
||||||
|
|||||||
Reference in New Issue
Block a user