mirror of
https://github.com/iridakos/goto.git
synced 2025-05-16 15:30:22 -07:00
Adds auto-completion and documentation for expand command
This commit is contained in:
parent
21c3b66a77
commit
df46ea166b
20
README.md
20
README.md
@ -111,6 +111,26 @@ or
|
|||||||
goto --list
|
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
|
### Cleanup
|
||||||
|
|
||||||
To cleanup the aliases from directories that are no longer accessible in your filesystem, use:
|
To cleanup the aliases from directories that are no longer accessible in your filesystem, use:
|
||||||
|
@ -309,7 +309,10 @@ function _complete_goto()
|
|||||||
prev="${COMP_WORDS[1]}"
|
prev="${COMP_WORDS[1]}"
|
||||||
|
|
||||||
if [[ $prev = "-u" ]] || [[ $prev = "--unregister" ]]; then
|
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"
|
_complete_goto_aliases "$cur"
|
||||||
fi
|
fi
|
||||||
elif [ "$COMP_CWORD" -eq "3" ]; then
|
elif [ "$COMP_CWORD" -eq "3" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user