diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-08-05 14:40:19 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-08-05 14:40:19 +1200 |
commit | 39653507bb9f83ed6081eff4650adfa63a088666 (patch) | |
tree | 723dbf4f23a5b96f82652fb28544e2f2f12263e9 /bash | |
parent | Pass bd options to cd (diff) | |
download | dotfiles-39653507bb9f83ed6081eff4650adfa63a088666.tar.gz dotfiles-39653507bb9f83ed6081eff4650adfa63a088666.zip |
Move var declaration closer to usage
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/pd.bash | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bash/bashrc.d/pd.bash b/bash/bashrc.d/pd.bash index 8003c966..db0ba799 100644 --- a/bash/bashrc.d/pd.bash +++ b/bash/bashrc.d/pd.bash @@ -4,7 +4,7 @@ # containing directory. In the absence of an argument, this just shifts up a # directory, i.e. `cd ..` pd() { - local arg target + local arg local -a opts for arg ; do case $arg in @@ -21,6 +21,7 @@ pd() { ;; esac done + local target case $# in 0) target=.. |