diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-08-05 14:42:49 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-08-05 14:42:49 +1200 |
commit | f911b18709f09a38c00710d846766b060d9360ee (patch) | |
tree | 03be8c9188f6789bdf5b99128f9d3e7fc1dcd588 /bash | |
parent | Move var declaration closer to usage (diff) | |
download | dotfiles-f911b18709f09a38c00710d846766b060d9360ee.tar.gz dotfiles-f911b18709f09a38c00710d846766b060d9360ee.zip |
Improve comments
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/pd.bash | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bash/bashrc.d/pd.bash b/bash/bashrc.d/pd.bash index db0ba799..2a157b2a 100644 --- a/bash/bashrc.d/pd.bash +++ b/bash/bashrc.d/pd.bash @@ -4,6 +4,8 @@ # containing directory. In the absence of an argument, this just shifts up a # directory, i.e. `cd ..` pd() { + + # For completeness' sake, we'll pass any options to cd local arg local -a opts for arg ; do @@ -21,6 +23,8 @@ pd() { ;; esac done + + # Determine target directory local target case $# in 0) @@ -37,6 +41,8 @@ pd() { return 2 ;; esac + + # If we have a target directory, try to change into it if [[ -n $target ]] ; then builtin cd "${opts[@]}" -- "$target" else |