diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-20 12:15:13 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-20 12:15:13 +1200 |
commit | 5c918328111bfdbdaa7838a8f10f499c30e98eeb (patch) | |
tree | d4c10212d18e892d41385bd1168719de965c5827 | |
parent | Improve error handling of cd() a bit (diff) | |
download | dotfiles-5c918328111bfdbdaa7838a8f10f499c30e98eeb.tar.gz dotfiles-5c918328111bfdbdaa7838a8f10f499c30e98eeb.zip |
Remove option term spec from bd()
It doesn't accept options; cd() needs to because it's a wrapper
-rw-r--r-- | sh/shrc.d/bd.sh | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sh/shrc.d/bd.sh b/sh/shrc.d/bd.sh index 0d1abbcf..5593ff4d 100644 --- a/sh/shrc.d/bd.sh +++ b/sh/shrc.d/bd.sh @@ -3,13 +3,9 @@ bd() { # Set positional parameters to an option terminator and what will hopefully # end up being a target directory - set -- -- "$( + set -- "$( - # If the first of the existing positional arguments is --, shift it - # off - [ "$1" = -- ] && shift - - # There's no more than one argument after that + # Check there's no more than one argument [ "$#" -le 1 ] || exit 1 # The requested pattern is the first argument, defaulting to just the @@ -63,5 +59,5 @@ bd() { )" || return # Try to change into the determined directory - command cd "$@" + command cd -- "$@" } |