Optimize _lp_smart_mark more: case .. esac
Use a 'case..esac' in _lp_smart_mark.
This commit is contained in:
parent
0381fb68e0
commit
78176780e0
26
liquidprompt
26
liquidprompt
@ -1309,26 +1309,22 @@ _lp_title()
|
|||||||
_lp_smart_mark()
|
_lp_smart_mark()
|
||||||
{
|
{
|
||||||
local mark
|
local mark
|
||||||
|
case "$LP_VCS_TYPE" in
|
||||||
|
git) mark="$LP_MARK_GIT" ;;
|
||||||
|
git-svn) mark="$LP_MARK_GIT$LP_MARK_SVN" ;;
|
||||||
|
hg) mark="$LP_MARK_HG" ;;
|
||||||
|
svn) mark="$LP_MARK_SVN" ;;
|
||||||
|
fossil) mark="$LP_MARK_FOSSIL" ;;
|
||||||
|
bzr) mark="$LP_MARK_BZR" ;;
|
||||||
|
disabled) mark="$LP_MARK_DISABLED" ;;
|
||||||
|
*)
|
||||||
if [[ -n "$LP_MARK_DEFAULT" ]]; then
|
if [[ -n "$LP_MARK_DEFAULT" ]]; then
|
||||||
mark=$LP_MARK_DEFAULT
|
mark=$LP_MARK_DEFAULT
|
||||||
else
|
else
|
||||||
mark="$_LP_MARK_SYMBOL"
|
mark="$_LP_MARK_SYMBOL"
|
||||||
fi
|
fi
|
||||||
if [[ "$1" == "git" ]]; then
|
;;
|
||||||
mark=$LP_MARK_GIT
|
esac
|
||||||
elif [[ "$1" == "git-svn" ]]; then
|
|
||||||
mark="$LP_MARK_GIT$LP_MARK_SVN"
|
|
||||||
elif [[ "$1" == "hg" ]]; then
|
|
||||||
mark=$LP_MARK_HG
|
|
||||||
elif [[ "$1" == "svn" ]]; then
|
|
||||||
mark=$LP_MARK_SVN
|
|
||||||
elif [[ "$1" == "fossil" ]]; then
|
|
||||||
mark=$LP_MARK_FOSSIL
|
|
||||||
elif [[ "$1" == "bzr" ]]; then
|
|
||||||
mark=$LP_MARK_BZR
|
|
||||||
elif [[ "$1" == "disabled" ]]; then
|
|
||||||
mark=$LP_MARK_DISABLED
|
|
||||||
fi
|
|
||||||
echo -ne "${LP_COLOR_MARK}${mark}${NO_COL}"
|
echo -ne "${LP_COLOR_MARK}${mark}${NO_COL}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user