aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/prompt.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-12-14 17:48:52 +1300
committerTom Ryder <tom@sanctum.geek.nz>2015-12-14 17:48:52 +1300
commit06f5ca98018fd4ba357b0e70b1e710b682b6cdb5 (patch)
tree76bc12131c82c87852e4183969d6969d9eeabf7f /bash/bashrc.d/prompt.bash
parentFix some English (diff)
downloaddotfiles-06f5ca98018fd4ba357b0e70b1e710b682b6cdb5.tar.gz
dotfiles-06f5ca98018fd4ba357b0e70b1e710b682b6cdb5.zip
Switch to a faster method of array appending
Does away with the nasty hack around man page discovery, and still compatible with Bash 2.05a
Diffstat (limited to 'bash/bashrc.d/prompt.bash')
-rw-r--r--bash/bashrc.d/prompt.bash16
1 files changed, 8 insertions, 8 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index e26460a4..12d68417 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -122,18 +122,18 @@ prompt() {
# Build state array from status output flags
local -a state
if ((ready)) ; then
- state=("${state[@]}" '+')
+ state[${#state[@]}]='+'
fi
if ((modified)) ; then
- state=("${state[@]}" '!')
+ state[${#state[@]}]='!'
fi
if ((untracked)) ; then
- state=("${state[@]}" '?')
+ state[${#state[@]}]='?'
fi
# Add another indicator if we have stashed changes
if git rev-parse --verify refs/stash >/dev/null 2>&1 ; then
- state=("${state[@]}" '^')
+ state[${#state[@]}]='^'
fi
# Print the status in brackets with a git: prefix
@@ -167,10 +167,10 @@ prompt() {
# Build state array from status output flags
local -a state
if ((modified)) ; then
- state=("${state[@]}" '!')
+ state[${#state[@]}]='!'
fi
if ((untracked)) ; then
- state=("${state[@]}" '?')
+ state[${#state[@]}]='?'
fi
# Print the status in brackets with an hg: prefix
@@ -225,10 +225,10 @@ prompt() {
# Add appropriate state flags
local -a state
if ((modified)) ; then
- state=("${state[@]}" '!')
+ state[${#state[@]}]='!'
fi
if ((untracked)) ; then
- state=("${state[@]}" '?')
+ state[${#state[@]}]='?'
fi
# Print the state in brackets with an svn: prefix