summaryrefslogtreecommitdiff
path: root/plugins/wd
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2020-10-21 16:57:03 -0600
committerTuowen Zhao <ztuowen@gmail.com>2020-10-21 16:57:03 -0600
commit058885f5263f29f046c96ea2ecf55e6dca3ed321 (patch)
tree5aca868fa5f9d16f39baa0c355f6056b5c8ea4da /plugins/wd
parent1774c426de3c4845e2d606c813c37067b8cf78d7 (diff)
parent3b1699b59527ee8095397b9909a37d55689a0481 (diff)
downloadzsh-058885f5263f29f046c96ea2ecf55e6dca3ed321.tar.gz
zsh-058885f5263f29f046c96ea2ecf55e6dca3ed321.tar.bz2
zsh-058885f5263f29f046c96ea2ecf55e6dca3ed321.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/wd')
-rw-r--r--plugins/wd/wd.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
index d5d38f25b..9085c5b7b 100644
--- a/plugins/wd/wd.sh
+++ b/plugins/wd/wd.sh
@@ -71,7 +71,7 @@ wd_print_msg()
wd_print_usage()
{
- cat <<- EOF
+ command cat <<- EOF
Usage: wd [command] [point]
Commands:
@@ -175,9 +175,9 @@ wd_add()
elif [[ $point =~ "[[:space:]]+" ]]
then
wd_exit_fail "Warp point should not contain whitespace"
- elif [[ $point == *:* ]]
+ elif [[ $point =~ : ]] || [[ $point =~ / ]]
then
- wd_exit_fail "Warp point cannot contain colons"
+ wd_exit_fail "Warp point contains illegal character (:/)"
elif [[ ${points[$point]} == "" ]] || [ ! -z "$force" ]
then
wd_remove "$point" > /dev/null
@@ -185,7 +185,7 @@ wd_add()
if (whence sort >/dev/null); then
local config_tmp=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX")
# use 'cat' below to ensure we respect $WD_CONFIG as a symlink
- sort -o "${config_tmp}" "$WD_CONFIG" && cat "${config_tmp}" > "$WD_CONFIG" && rm "${config_tmp}"
+ command sort -o "${config_tmp}" "$WD_CONFIG" && command cat "${config_tmp}" > "$WD_CONFIG" && command rm "${config_tmp}"
fi
wd_export_static_named_directories
@@ -270,7 +270,7 @@ wd_ls()
wd_path()
{
wd_getdir "$1"
- echo "$(echo "$dir" | sed "s:${HOME}:~:g")"
+ echo "$(echo "$dir" | sed "s:~:${HOME}:g")"
}
wd_show()