This commit is contained in:
Ivan
2022-04-05 11:42:28 +03:00
commit 6dc0eb0fcf
5565 changed files with 1200500 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
function _roscomplete_node_transform
{
local arg opts
COMPREPLY=()
arg="${COMP_WORDS[COMP_CWORD]}"
local cword=$COMP_CWORD
for a in $(seq $((COMP_CWORD-1))); do
if [ -z "${COMP_WORDS[a]//-*}" ]; then
((cword--))
fi
done
local words=(${COMP_WORDS[@]//-*})
if [[ $cword == 3 ]]; then
opts=`rostopic list 2> /dev/null`
COMPREPLY=($(compgen -W "$opts" -- ${arg}))
elif [[ $cword == 5 ]]; then
opts=`rosmsg list 2> /dev/null`
COMPREPLY=($(compgen -W "$opts" -- ${arg}))
fi
}
_sav_transform_roscomplete_rosrun=$(complete | grep -w rosrun | awk '{print $3}')
function is_transform_node
{
local words=(${COMP_WORDS[@]//-*})
[ ${#words[@]} -gt 2 ] && \
[ "${words[1]}" = "topic_tools" ] && \
[ "${words[2]}" = "transform" ]
}
function _roscomplete_rosrun_transform
{
if is_transform_node; then
_roscomplete_node_transform
else
eval "$_sav_transform_roscomplete_rosrun"
fi
}
complete -F "_roscomplete_rosrun_transform" "rosrun"