mirror of
https://github.com/iridakos/goto.git
synced 2025-05-16 07:20:17 -07:00
parent
0b3b8527a9
commit
19393468fc
8
goto.sh
8
goto.sh
@ -25,7 +25,7 @@
|
|||||||
function goto()
|
function goto()
|
||||||
{
|
{
|
||||||
local target
|
local target
|
||||||
GOTO_DB="$HOME/.goto"
|
_goto_resolve_db
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
# display usage and exit when no args
|
# display usage and exit when no args
|
||||||
@ -61,6 +61,11 @@ function goto()
|
|||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _goto_resolve_db()
|
||||||
|
{
|
||||||
|
GOTO_DB="$HOME/.goto"
|
||||||
|
}
|
||||||
|
|
||||||
function _goto_usage()
|
function _goto_usage()
|
||||||
{
|
{
|
||||||
cat <<\USAGE
|
cat <<\USAGE
|
||||||
@ -268,6 +273,7 @@ function _complete_goto_commands()
|
|||||||
function _complete_goto_aliases()
|
function _complete_goto_aliases()
|
||||||
{
|
{
|
||||||
local IFS=$'\n' matches
|
local IFS=$'\n' matches
|
||||||
|
_goto_resolve_db
|
||||||
|
|
||||||
# shellcheck disable=SC2207
|
# shellcheck disable=SC2207
|
||||||
matches=($(sed -n "/^$1/p" "$GOTO_DB" 2>/dev/null))
|
matches=($(sed -n "/^$1/p" "$GOTO_DB" 2>/dev/null))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user