Adds auto-completion and documentation for expand command

This commit is contained in:
Shawn Wallis 2018-03-09 13:48:45 -05:00
parent 21c3b66a77
commit df46ea166b
2 changed files with 24 additions and 1 deletions

View File

@ -111,6 +111,26 @@ or
goto --list
```
### Expand an alias
To expand an alias to its value, use:
```bash
goto -x <alias>
```
or
```bash
goto --expand <alias>
```
#### 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:

View File

@ -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