diff --git a/README.md b/README.md index b5c8737..86d9d29 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,26 @@ or goto --list ``` +### Expand an alias + +To expand an alias to its value, use: +```bash +goto -x +``` +or +```bash +goto --expand +``` + +#### Example +```bash +goto -x last_release +``` +or +```bash +goto --expand last_release +``` + ### Cleanup To cleanup the aliases from directories that are no longer accessible in your filesystem, use: diff --git a/goto.bash b/goto.bash index c601d0a..46b8147 100644 --- a/goto.bash +++ b/goto.bash @@ -309,7 +309,10 @@ function _complete_goto() prev="${COMP_WORDS[1]}" if [[ $prev = "-u" ]] || [[ $prev = "--unregister" ]]; then - # prompt with aliases only if user tries to unregister one + # prompt with aliases if user tries to unregister one + _complete_goto_aliases "$cur" + elif [[ $prev = "-x" ]] || [[ $prev = "--expand" ]]; then + # prompt with aliases if user tries to expand one _complete_goto_aliases "$cur" fi elif [ "$COMP_CWORD" -eq "3" ]; then