mirror of
https://github.com/iridakos/goto.git
synced 2024-05-11 05:55:16 +00:00
@@ -5,6 +5,11 @@ All notable changes to `goto` will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.2.4] - 2019-05-30
|
||||
|
||||
### Added
|
||||
- support bash completion for aliases of `goto`
|
||||
|
||||
## [1.2.3] - 2018-03-14
|
||||
|
||||
### Added
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
A shell utility allowing users to navigate to aliased directories supporting auto-completion :feet:
|
||||
|
||||

|
||||

|
||||
|
||||
## How does it work?
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ USAGE
|
||||
# Displays version
|
||||
_goto_version()
|
||||
{
|
||||
echo "goto version 1.2.3.1"
|
||||
echo "goto version 1.2.4"
|
||||
}
|
||||
|
||||
# Expands directory.
|
||||
@@ -438,16 +438,22 @@ _complete_goto_zsh()
|
||||
return $ret
|
||||
}
|
||||
|
||||
# Register the goto completions.
|
||||
if [ -n "${BASH_VERSION}" ]; then
|
||||
if ! [[ $(uname -s) =~ Darwin* ]]; then
|
||||
complete -o filenames -F _complete_goto_bash goto
|
||||
else
|
||||
complete -F _complete_goto_bash goto
|
||||
fi
|
||||
elif [ -n "${ZSH_VERSION}" ]; then
|
||||
compdef _complete_goto_zsh goto
|
||||
else
|
||||
echo "Unsupported shell."
|
||||
exit 1
|
||||
fi
|
||||
aliases=($(alias | sed -n "s/.*\s\(.*\)='goto'/\1/p"))
|
||||
aliases+=('goto')
|
||||
|
||||
for i in "${aliases[@]}"
|
||||
do
|
||||
# Register the goto completions.
|
||||
if [ -n "${BASH_VERSION}" ]; then
|
||||
if ! [[ $(uname -s) =~ Darwin* ]]; then
|
||||
complete -o filenames -F _complete_goto_bash $i
|
||||
else
|
||||
complete -F _complete_goto_bash $i
|
||||
fi
|
||||
elif [ -n "${ZSH_VERSION}" ]; then
|
||||
compdef _complete_goto_zsh $i
|
||||
else
|
||||
echo "Unsupported shell."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user