aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/cd.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-02-10 23:54:25 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-02-10 23:54:25 +1300
commit79309afa6f6d8b4f3a607694608b499db6b992fa (patch)
tree627a59b4d7182ccca6d7bfb613895e876bfd25ed /bash/bashrc.d/cd.bash
parentAdd comment (diff)
downloaddotfiles-79309afa6f6d8b4f3a607694608b499db6b992fa.tar.gz
dotfiles-79309afa6f6d8b4f3a607694608b499db6b992fa.zip
Use space before semicolon as command separator
Diffstat (limited to 'bash/bashrc.d/cd.bash')
-rw-r--r--bash/bashrc.d/cd.bash10
1 files changed, 5 insertions, 5 deletions
diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash
index 6644bd1a..26cffae0 100644
--- a/bash/bashrc.d/cd.bash
+++ b/bash/bashrc.d/cd.bash
@@ -3,17 +3,17 @@
cd() {
local arg dir endopts
local -a opts dirs
- for arg in "$@"; do
- if [[ $arg == -- ]]; then
+ for arg in "$@" ; do
+ if [[ $arg == -- ]] ; then
endopts=1
- elif [[ $arg == -* ]] && ! ((endopts)); then
+ elif [[ $arg == -* ]] && ! ((endopts)) ; then
opts=("${opts[@]}" "$arg")
else
dirs=("${dirs[@]}" "$arg")
fi
done
- if ((${#dirs[@]} == 2)); then
- if [[ $PWD == *"${dirs[0]}"* ]]; then
+ if ((${#dirs[@]} == 2)) ; then
+ if [[ $PWD == *"${dirs[0]}"* ]] ; then
builtin cd "${opts[@]}" \
-- "${PWD/${dirs[0]}/${dirs[1]}}"
else