New default theme with toggle-able legacy theme

* This sets the newly proposed theme as the main theme. In order to
  switch back to the legacy theme, set _MENU_THEME to legacy.
  This feature is currently an experimental feature and may change
  in the future.

* Fixes documentation and updates test to reflect newly changed theme.
This commit is contained in:
Tom Ice
2019-05-12 19:32:11 -04:00
parent 90d118f09f
commit bdfe3beb25
4 changed files with 36 additions and 33 deletions

View File

@@ -25,7 +25,7 @@ else
fi
# Default menu theme
# Set an alternative by typing "export _MENU_THEME=alternative"
# Set the legacy theme by typing "export _MENU_THEME=legacy"
_theme="${_MENU_THEME:=default}"
################################################################################
@@ -116,8 +116,8 @@ ADDITIONAL USAGE
ex: export _GIT_LIMIT=20
You can exclude a directory from the stats by using pathspec
ex: export _GIT_PATHSPEC=':!directory'
You can set _MENU_THEME to display an alternative color scheme
ex: export _MENU_THEME=alternative"
You can set _MENU_THEME to display the legacy color scheme
ex: export _MENU_THEME=legacy"
}
################################################################################
@@ -136,39 +136,42 @@ function show_menu() {
local text=""
local nums=""
local help_txt=""
local exit_txt=""
# Adjustable color menu option
if [[ "${_theme}" == "alternative" ]]; then
titles="${bold}${cyan}"
text="${normal}${white}"
nums="${bold}${white}"
help_txt="${cyan}"
else
if [[ "${_theme}" == "legacy" ]]; then
titles="${bold}${red}"
text="${normal}${cyan}"
nums="${bold}${yellow}"
help_txt="${white}"
help_txt="${normal}${yellow}"
exit_txt="${bold}${red}"
else
titles="${bold}${cyan}"
text="${normal}${white}"
nums="${normal}${bold}${white}"
help_txt="${normal}${cyan}"
exit_txt="${bold}${cyan}"
fi
echo -e "\n${titles} Generate:${normal}"
echo -e "${nums} 1)${text} Contribution stats (by author)${normal}"
echo -e "${nums} 2)${text} Contribution stats (by author) on a specific branch${normal}"
echo -e "${nums} 3)${text} Git changelogs (last $_limit days)${normal}"
echo -e "${nums} 4)${text} Git changelogs by author${normal}"
echo -e "${nums} 5)${text} My daily status${normal}"
echo -e "\n${titles} List:${normal}"
echo -e "${nums} 6)${text} Branch tree view (last $_limit)${normal}"
echo -e "${nums} 7)${text} All branches (sorted by most recent commit)${normal}"
echo -e "${nums} 8)${text} All contributors (sorted by name)${normal}"
echo -e "${nums} 9)${text} Git commits per author${normal}"
echo -e "${nums} 10)${text} Git commits per date${normal}"
echo -e "${nums} 11)${text} Git commits per month${normal}"
echo -e "${nums} 12)${text} Git commits per weekday${normal}"
echo -e "${nums} 13)${text} Git commits per hour${normal}"
echo -e "${nums} 14)${text} Git commits by author per hour${normal}"
echo -e "\n${titles} Suggest${normal}:"
echo -e "${nums} 15)${text} Code reviewers (based on git history)${normal}"
echo -e "\n${help_txt}Please enter a menu option or ${bold}press Enter to exit.${normal}"
echo -e "${nums} 1)${text} Contribution stats (by author)"
echo -e "${nums} 2)${text} Contribution stats (by author) on a specific branch"
echo -e "${nums} 3)${text} Git changelogs (last $_limit days)"
echo -e "${nums} 4)${text} Git changelogs by author"
echo -e "${nums} 5)${text} My daily status"
echo -e "\n${titles} List:"
echo -e "${nums} 6)${text} Branch tree view (last $_limit)"
echo -e "${nums} 7)${text} All branches (sorted by most recent commit)"
echo -e "${nums} 8)${text} All contributors (sorted by name)"
echo -e "${nums} 9)${text} Git commits per author"
echo -e "${nums} 10)${text} Git commits per date"
echo -e "${nums} 11)${text} Git commits per month"
echo -e "${nums} 12)${text} Git commits per weekday"
echo -e "${nums} 13)${text} Git commits per hour"
echo -e "${nums} 14)${text} Git commits by author per hour"
echo -e "\n${titles} Suggest:"
echo -e "${nums} 15)${text} Code reviewers (based on git history)"
echo -e "\n${help_txt}Please enter a menu option or ${exit_txt}press Enter to exit."
echo -n "${text}> ${normal}"
read -r opt
}