diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-04-29 17:35:36 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-04-29 17:35:36 +1200 |
commit | 62c8407e2d23c52e71f099de920ec91fce3f622b (patch) | |
tree | 1871b53141ec0c8f6f3ca2a9a57638ac0fb3e24b /bash/bashrc.d/pd.bash | |
parent | Only print line if at least one arg (diff) | |
download | dotfiles-62c8407e2d23c52e71f099de920ec91fce3f622b.tar.gz dotfiles-62c8407e2d23c52e71f099de920ec91fce3f622b.zip |
Use FUNCNAME rather than hardcoding helper funcs
Diffstat (limited to 'bash/bashrc.d/pd.bash')
-rw-r--r-- | bash/bashrc.d/pd.bash | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bash/bashrc.d/pd.bash b/bash/bashrc.d/pd.bash index 346816a1..86a0fb18 100644 --- a/bash/bashrc.d/pd.bash +++ b/bash/bashrc.d/pd.bash @@ -31,14 +31,16 @@ pd() { target=${target%/*} ;; *) - printf 'bash: pd: too many arguments\n' >&2 + printf 'bash: %s: too many arguments\n' \ + "$FUNCNAME" >&2 return 1 ;; esac if [[ $target ]] ; then builtin cd "${opts[@]}" -- "$target" else - printf 'bash: pd: error calculating parent directory\n' >&2 + printf 'bash: %s: error calculating parent directory\n' \ + "$FUNCNAME" >&2 return 1 fi } |