mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-27 20:36:29 -04:00
32 lines
711 B
Plaintext
32 lines
711 B
Plaintext
#compdef mutn
|
|
|
|
libmuttonEntryRoot="$HOME/.local/share/libmutton"
|
|
libmuttonFullPaths=("$libmuttonEntryRoot"/**/*)
|
|
libmuttonTrimmedPaths=()
|
|
for scanPath in "${libmuttonFullPaths[@]}"; do
|
|
# exclude directories
|
|
[ -f "$scanPath" ] && libmuttonTrimmedPaths+=("${scanPath#$libmuttonEntryRoot}")
|
|
done
|
|
[[ -z $libmuttonTrimmedPaths ]] && libmuttonTrimmedPaths=(help)
|
|
|
|
case ${words[-2]} in
|
|
mutn )
|
|
compadd $libmuttonTrimmedPaths
|
|
;;
|
|
/* )
|
|
compadd {copy,edit,gen,add,shear}
|
|
;;
|
|
add )
|
|
compadd {password,note,folder}
|
|
;;
|
|
copy )
|
|
compadd {password,username,totp,url,note,menu}
|
|
;;
|
|
edit )
|
|
compadd {password,username,totp,url,note,rename}
|
|
;;
|
|
gen )
|
|
compadd update
|
|
;;
|
|
esac
|