mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-28 12:56:28 -04:00
Former-commit-id: ebad1892f42f8017ebf584b5130d2781465b3905 Former-commit-id: 7eb5c348125061d42a12f4ef756b8ca0c8644bab
31 lines
586 B
Bash
31 lines
586 B
Bash
#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
|