added helper function git_prompt_color_samples to show a list with all available named colors

master
Martin Gondermann 11 years ago
parent d10f613100
commit a647ceb08e
  1. 1
      README.md
  2. 15
      git-prompt-help.sh

@ -162,6 +162,7 @@ GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # displays as ✘-1 fo
- You can get help on the git prompt with the function ``git_prompt_help``. - You can get help on the git prompt with the function ``git_prompt_help``.
Examples are available with ``git_prompt_examples``. Examples are available with ``git_prompt_examples``.
A list of all available named colors is available with `git_prompt_color_samples`
- If you make any changes to any file that is sourced by `gitprompt.sh`, you - If you make any changes to any file that is sourced by `gitprompt.sh`, you
should run this command, so that the next prompt update will find all the should run this command, so that the next prompt update will find all the

@ -58,3 +58,18 @@ These are examples of the git prompt:
EOF EOF
} }
git_prompt_color_samples() {
showColor() {
local color=$(eval echo "\${$1}")
echo -e "${color}$1${ResetColor}" | sed 's/\\\]//g' | sed 's/\\\[//g'
}
while (( x < 8 )) ; do
showColor ${ColorNames[x]}
showColor "Dim${ColorNames[x]}"
showColor "Bold${ColorNames[x]}"
showColor "Bright${ColorNames[x]}"
(( x++ ))
done
}

Loading…
Cancel
Save