Factor out the comp logic to a zsh comp file
This commit is contained in:
parent
f6bfb103d1
commit
76faa1cf8f
2 changed files with 11 additions and 10 deletions
8
_goto
Normal file
8
_goto
Normal file
|
@ -0,0 +1,8 @@
|
|||
function _goto {
|
||||
for label in $(_awk '{print $1}' `_gotofile`)
|
||||
do
|
||||
compadd "$@" $label
|
||||
done
|
||||
};
|
||||
|
||||
compdef _goto goto
|
|
@ -1,4 +1,6 @@
|
|||
#compdef _goto
|
||||
#!/usr/bin/zsh
|
||||
#
|
||||
# goto.zsh, a tool for bookmarking directories
|
||||
|
||||
function _awk {
|
||||
which awk &>/dev/null && awk $@ || \
|
||||
|
@ -46,12 +48,3 @@ function goto {
|
|||
fi
|
||||
fi
|
||||
};
|
||||
|
||||
function _goto {
|
||||
for label in $(_awk '{print $1}' `_gotofile`)
|
||||
do
|
||||
compadd "$@" $label
|
||||
done
|
||||
};
|
||||
|
||||
compdef _goto goto
|
||||
|
|
Loading…
Reference in a new issue