mirror of
https://github.com/iridakos/goto.git
synced 2025-05-18 16:30:13 -07:00
parent
dae1cbd612
commit
0baf5c1481
11
README.md
11
README.md
@ -134,6 +134,17 @@ or
|
|||||||
goto --help
|
goto --help
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Version
|
||||||
|
|
||||||
|
To view the tool's version, use:
|
||||||
|
```bash
|
||||||
|
goto -v
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```bash
|
||||||
|
goto --version
|
||||||
|
```
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
* ~~Test on macOS~~ extensively
|
* ~~Test on macOS~~ extensively
|
||||||
|
13
goto.bash
13
goto.bash
@ -51,6 +51,9 @@ function goto()
|
|||||||
-h|--help)
|
-h|--help)
|
||||||
_goto_usage
|
_goto_usage
|
||||||
;;
|
;;
|
||||||
|
-v|--version)
|
||||||
|
_goto_version
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
_goto_directory "$subcommand"
|
_goto_directory "$subcommand"
|
||||||
;;
|
;;
|
||||||
@ -76,9 +79,17 @@ OPTIONS:
|
|||||||
goto -c|--cleanup
|
goto -c|--cleanup
|
||||||
-h, --help: prints this help
|
-h, --help: prints this help
|
||||||
goto -h|--help
|
goto -h|--help
|
||||||
|
-v, --version: displays the version of the goto script
|
||||||
|
goto -v|--version
|
||||||
USAGE
|
USAGE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Displays version
|
||||||
|
function _goto_version()
|
||||||
|
{
|
||||||
|
echo "goto version 1.0.0"
|
||||||
|
}
|
||||||
|
|
||||||
# Expands directory.
|
# Expands directory.
|
||||||
# Helpful for ~, ., .. paths
|
# Helpful for ~, ., .. paths
|
||||||
function _goto_expand_directory()
|
function _goto_expand_directory()
|
||||||
@ -214,7 +225,7 @@ function _goto_resolve_alias()
|
|||||||
# Completes the goto function with the available commands
|
# Completes the goto function with the available commands
|
||||||
function _complete_goto_commands()
|
function _complete_goto_commands()
|
||||||
{
|
{
|
||||||
mapfile -t COMPREPLY < <(compgen -W '-r --register -u --unregister -l --list -c --cleanup' -- "$1")
|
mapfile -t COMPREPLY < <(compgen -W '-r --register -u --unregister -l --list -c --cleanup -v --version' -- "$1")
|
||||||
}
|
}
|
||||||
|
|
||||||
# Completes the goto function with the available aliases
|
# Completes the goto function with the available aliases
|
||||||
|
Loading…
x
Reference in New Issue
Block a user