diff options
author | diego <sirdiego@users.noreply.github.com> | 2016-10-07 23:54:54 +0200 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2016-10-07 23:54:54 +0200 |
commit | d69f2850afc189310b40141c839480b42f71775c (patch) | |
tree | d099cec097806f3f2555e0a034f299cc3ac8a1c6 /plugins/jump | |
parent | 7f9b7733507d57a6cd4f38d0c0db830647c1940d (diff) | |
download | zsh-d69f2850afc189310b40141c839480b42f71775c.tar.gz zsh-d69f2850afc189310b40141c839480b42f71775c.tar.bz2 zsh-d69f2850afc189310b40141c839480b42f71775c.zip |
Add non 0 exit code for missing jump targets (#5500)
This allows for the user to combine the jump command with something else. In my example cd and jump are now combined like this:
```bash
jumpcd() {
jump $1 > /dev/null || cd $1
}
alias cd="jumpcd"
```
Diffstat (limited to 'plugins/jump')
-rw-r--r-- | plugins/jump/jump.plugin.zsh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh index e58e7373d..86d9553a2 100644 --- a/plugins/jump/jump.plugin.zsh +++ b/plugins/jump/jump.plugin.zsh @@ -9,7 +9,7 @@ export MARKPATH=$HOME/.marks jump() { - cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1" + cd -P "$MARKPATH/$1" 2>/dev/null || {echo "No such mark: $1"; return 1} } mark() { |