mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-05 08:37:20 -04:00
Use more specific names for global variables in Bash and ZSH completions
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
#compdef mutn
|
||||
|
||||
mutnPath="$HOME/.local/share/libmutton"
|
||||
fullPaths=("$mutnPath"/**/*)
|
||||
trimmedPaths=()
|
||||
for scanPath in "${fullPaths[@]}"; do
|
||||
libmuttonEntryRoot="$HOME/.local/share/libmutton"
|
||||
libmuttonFullPaths=("$libmuttonEntryRoot"/**/*)
|
||||
libmuttonTrimmedPaths=()
|
||||
for scanPath in "${libmuttonFullPaths[@]}"; do
|
||||
# exclude directories
|
||||
[ -f "$scanPath" ] && trimmedPaths+=("${scanPath#$mutnPath}")
|
||||
[ -f "$scanPath" ] && libmuttonTrimmedPaths+=("${scanPath#$libmuttonEntryRoot}")
|
||||
done
|
||||
[[ -z $trimmedPaths ]] && trimmedPaths=(help)
|
||||
[[ -z $libmuttonTrimmedPaths ]] && libmuttonTrimmedPaths=(help)
|
||||
|
||||
case ${words[-2]} in
|
||||
mutn )
|
||||
compadd $trimmedPaths
|
||||
compadd $libmuttonTrimmedPaths
|
||||
;;
|
||||
/* )
|
||||
compadd {copy,edit,gen,add,shear}
|
||||
|
||||
Reference in New Issue
Block a user