1 Star 0 Fork 0

xxgc2hhb/openrave

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
openrave_completion.bash.in 5.50 KB
一键复制 编辑 原始数据 按行查看 历史
rosen.diankov@gmail.com 提交于 2020-08-06 11:12 . auto complete msgpack
# Programmable completion for openrave under bash. Source this file
# or add it to ~/.bash_completion or /etc/bash_completion.d
resource_types="json|dae|zae|xml|iv|vrml|wrl|stl|blend|3ds|ase|obj|ply|dxf|lwo|lxo|ac|ms3d|x|mesh.xml|irrmesh|irr|nff|off|raw|msgpack"
function _complete_openravepy {
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
if [[ $COMP_CWORD -ge 2 ]]; then
if [[ $COMP_CWORD == 2 ]]; then
case ${COMP_WORDS[1]} in
--listinterfaces)
opts="planner robot sensorsystem controller module inversekinematicssolver kinbody physicsengine sensor collisionchecker trajectory viewer spacesampler"
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
--example)
opts=`openrave@OPENRAVE_BIN_SUFFIX@.py --listexamples`
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
--database)
opts=`openrave@OPENRAVE_BIN_SUFFIX@.py --listdatabases`
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
esac
else
# just add in the xml and dae files, we don't have auto-completations for the examples/databases yet
COMPREPLY=($(compgen -f -X "!*.+(${resource_types})" -- ${cur}))
return 0
fi
fi
case "${prev}" in
--level|-l)
opts="fatal error warn info debug verbose"
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
--collision)
opts=`openrave@OPENRAVE_BIN_SUFFIX@.py --listinterfaces collisionchecker`
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
--viewer)
opts=`openrave@OPENRAVE_BIN_SUFFIX@.py --listinterfaces viewer`
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
--physics)
opts=`openrave@OPENRAVE_BIN_SUFFIX@.py --listinterfaces physics`
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
--loadplugin)
COMPREPLY=($(compgen -f -X "!*.so" -- ${cur}))
return 0
;;
*)
;;
esac
# not processing a current option, so offer all the options again
opts="--loadplugin --collision --physics --viewer --server --serverport --level --ipython --pythoncmd --listinterfaces --listplugins --listdatabases --listexamples --help"
if [[ $COMP_CWORD == 1 ]]; then
# these options transfer the args to another program
opts="$opts --database --example"
fi
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
if [[ ${cur} != -* ]] ; then
# add in xml and dae and zae files
COMPREPLY=($(compgen -f -X "!*.+(${resource_types})" -- ${cur}) ${COMPREPLY[@]})
fi
}
function _complete_openrave_robotpy {
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case "${prev}" in
--info)
opts="manipulators sensors links joints"
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
--list)
opts="manipulators sensors links joints"
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
--hash)
opts="body kinematics robot"
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
--manipname)
COMP_WORDS2=("${COMP_WORDS[@]}")
unset COMP_WORDS2[COMP_CWORD]
unset COMP_WORDS2[COMP_CWORD-1]
unset COMP_WORDS2[0]
opts=`openrave0.3-robot.py ${COMP_WORDS2[@]} --list manipulators`
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
--sensorname)
COMP_WORDS2=("${COMP_WORDS[@]}")
unset COMP_WORDS2[COMP_CWORD]
unset COMP_WORDS2[COMP_CWORD-1]
unset COMP_WORDS2[0]
opts=`openrave0.3-robot.py ${COMP_WORDS2[@]} --list sensors`
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
return 0
;;
*)
;;
esac
# not processing a current option, so offer all the options again
opts="--manipname --sensorname --hash --info --list --help"
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
if [[ ${cur} != -* ]] ; then
# add in xml and dae and zae files
COMPREPLY=($(compgen -f -X "!*.+(${resource_types})" -- ${cur}) ${COMPREPLY[@]})
fi
}
function _complete_openrave_createpluginpy {
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--usecore --planner --robot --sensorsystem --controller --module --iksolver --kinbody --physicsengine --sensor --collisionchecker --trajectory --viewer --spacesampler --help"
COMPREPLY=($(compgen -W "$opts" -- ${cur}))
}
complete -F "_complete_openravepy" -o filenames -o plusdirs "openrave.py"
complete -F "_complete_openrave_robotpy" -o filenames -o plusdirs "openrave-robot.py"
complete -F "_complete_openrave_createpluginpy" "openrave-createplugin.py"
complete -F "_complete_openravepy" -o filenames -o plusdirs "openrave@OPENRAVE_BIN_SUFFIX@.py"
complete -F "_complete_openrave_robotpy" -o filenames -o plusdirs "openrave@OPENRAVE_BIN_SUFFIX@-robot.py"
complete -F "_complete_openrave_createpluginpy" "openrave@OPENRAVE_BIN_SUFFIX@-createplugin.py"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nexusocc/openrave.git
git@gitee.com:nexusocc/openrave.git
nexusocc
openrave
openrave
master

搜索帮助

A270a887 8829481 3d7a4017 8829481