mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
dash: simplify completion logic
This commit is contained in:
parent
e0bc646993
commit
b45e0f4836
1 changed files with 23 additions and 29 deletions
|
@ -35,36 +35,30 @@ _dash() {
|
||||||
if [[ "$locator" == "platform" ]]; then
|
if [[ "$locator" == "platform" ]]; then
|
||||||
# Since these are the only special cases right now, let's not do the
|
# Since these are the only special cases right now, let's not do the
|
||||||
# expensive processing unless we have to
|
# expensive processing unless we have to
|
||||||
if [[ "$keyword" == "python" || "$keyword" == "java" || \
|
if [[ "$keyword" = (python|java|qt|cocos2d) ]]; then
|
||||||
"$keyword" == "qt" || "$keyword" == "cocs2d" ]]; then
|
|
||||||
docsetName=`echo $doc | grep -Eo "docsetName = .*?;" | sed -e "s/docsetName = \(.*\);/\1/" -e "s/[\":]//g"`
|
docsetName=`echo $doc | grep -Eo "docsetName = .*?;" | sed -e "s/docsetName = \(.*\);/\1/" -e "s/[\":]//g"`
|
||||||
if [[ "$keyword" == "python" ]]; then
|
case "$keyword" in
|
||||||
if [[ "$docsetName" == "Python 2" ]]; then
|
python)
|
||||||
keyword="python2"
|
case "$docsetName" in
|
||||||
elif [[ "$docsetName" == "Python 3" ]]; then
|
"Python 2") keyword="python2" ;;
|
||||||
keyword="python3"
|
"Python 3") keyword="python3" ;;
|
||||||
fi
|
esac ;;
|
||||||
elif [[ "$keyword" == "java" ]]; then
|
java)
|
||||||
if [[ "$docsetName" == "Java SE7" ]]; then
|
case "$docsetName" in
|
||||||
keyword="java7"
|
"Java SE7") keyword="java7" ;;
|
||||||
elif [[ "$docsetName" == "Java SE6" ]]; then
|
"Java SE6") keyword="java6" ;;
|
||||||
keyword="java6"
|
"Java SE8") keyword="java8" ;;
|
||||||
elif [[ "$docsetName" == "Java SE8" ]]; then
|
esac ;;
|
||||||
keyword="java8"
|
qt)
|
||||||
fi
|
case "$docsetName" in
|
||||||
elif [[ "$keyword" == "qt" ]]; then
|
"Qt 5") keyword="qt5" ;;
|
||||||
if [[ "$docsetName" == "Qt 5" ]]; then
|
"Qt 4"|Qt) keyword="qt4" ;;
|
||||||
keyword="qt5"
|
esac ;;
|
||||||
elif [[ "$docsetName" == "Qt 4" ]]; then
|
cocos2d)
|
||||||
keyword="qt4"
|
case "$docsetName" in
|
||||||
elif [[ "$docsetName" == "Qt" ]]; then
|
Cocos3D) keyword="cocos3d" ;;
|
||||||
keyword="qt4"
|
esac ;;
|
||||||
fi
|
esac
|
||||||
elif [[ "$keyword" == "cocos2d" ]]; then
|
|
||||||
if [[ "$docsetName" == "Cocos3D" ]]; then
|
|
||||||
keyword="cocos3d"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue