Files
sshyp/extra/completion.zsh
T
RandyTheSilly 0c85703a73 Properly reset trimmed_paths for zsh completion
Former-commit-id: adda3df4ca4afbc7da162fb64592e853617802d4
Former-commit-id: 96917ce98bef0c879f392a2444f6d600589d9b53
2023-04-01 23:44:22 -04:00

31 lines
586 B
Bash
Executable File

#compdef sshyp
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
[[ -z $trimmed_paths ]] && trimmed_paths=(help)
case ${words[-2]} in
sshyp )
compadd $trimmed_paths
;;
/* )
compadd {add,gen,edit,copy,shear}
;;
add )
compadd {password,note,folder}
;;
copy )
compadd {password,username,url,note}
;;
edit )
compadd {password,username,url,note,relocate}
;;
gen )
compadd update
;;
esac