From 5c918328111bfdbdaa7838a8f10f499c30e98eeb Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 20 Aug 2016 12:15:13 +1200 Subject: Remove option term spec from bd() It doesn't accept options; cd() needs to because it's a wrapper --- sh/shrc.d/bd.sh | 10 +++------- 1 file 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 -- "$@" } -- cgit v1.2.3