Files
sshyp/extra/completion.zsh
T
RandyTheSilly 41c9d0a22b Complete 'help' if the entry directory is empty or does not exist
Former-commit-id: 1167f06b14ce50baa0c96e67a835247c6579aaa9
Former-commit-id: ea6be360d50c16579253d1e2d0b1825c5a1f1a4a
2023-04-01 23:19:56 -04:00

30 lines
568 B
Bash
Executable File

#compdef sshyp
sshyp_path="$HOME/.local/share/sshyp"
full_paths=("$sshyp_path"/**/*.gpg)
for scan_path in "${full_paths[@]}"; do
trimmed_paths+=("${${scan_path#$sshyp_path}%????}")
done
[[ -v 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