mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-28 04:46:34 -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
|
||||
local full_paths=("$sshyp_path"/**/*.gpg)
|
||||
$glob_status # set recursive globbing to user default
|
||||
for path in "${full_paths[@]}"; do
|
||||
trimmed_paths+=("${path:${#sshyp_path}:-4}")
|
||||
for scan_path in "${full_paths[@]}"; do
|
||||
trimmed_paths+=("${scan_path:${#sshyp_path}:-4}")
|
||||
done
|
||||
if [ "${trimmed_paths[0]}" == '/**/*' ]; then trimmed_paths[0]=help; fi
|
||||
} &&
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
|
||||
sshyp_path="$HOME/.local/share/sshyp"
|
||||
full_paths=("$sshyp_path"/**/*.gpg)
|
||||
trimmed_paths=()
|
||||
for scan_path in "${full_paths[@]}"; do
|
||||
trimmed_paths+=("${${scan_path#$sshyp_path}%????}")
|
||||
done
|
||||
[[ -v trimmed_paths ]] || trimmed_paths=(help)
|
||||
[[ -z $trimmed_paths ]] && trimmed_paths=(help)
|
||||
|
||||
case ${words[-2]} in
|
||||
sshyp )
|
||||
|
||||
Reference in New Issue
Block a user