rosbash: command complete for rosnode, rosparam, rostopic, and rosservice

This commit is contained in:
Ken Conley 2009-12-18 04:17:36 +00:00
parent c57b5580ec
commit 2c1d4e40dd
1 changed files with 52 additions and 0 deletions

View File

@ -304,6 +304,54 @@ function _roscomplete_rosbag {
COMPREPLY=($(compgen -f -- ${arg}))
fi
}
function _roscomplete_rosnode {
COMPREPLY=()
arg="${COMP_WORDS[COMP_CWORD]}"
if [[ $COMP_CWORD == 1 ]]; then
opts="ping list info machine kill"
COMPREPLY=($(compgen -W "$opts" -- ${arg}))
else
COMPREPLY=($(compgen -f -- ${arg}))
fi
}
function _roscomplete_rosparam {
COMPREPLY=()
arg="${COMP_WORDS[COMP_CWORD]}"
if [[ $COMP_CWORD == 1 ]]; then
opts="set get load dump delete list"
COMPREPLY=($(compgen -W "$opts" -- ${arg}))
else
COMPREPLY=($(compgen -f -- ${arg}))
fi
}
function _roscomplete_rostopic {
COMPREPLY=()
arg="${COMP_WORDS[COMP_CWORD]}"
if [[ $COMP_CWORD == 1 ]]; then
opts="bw echo hz list pub type find"
COMPREPLY=($(compgen -W "$opts" -- ${arg}))
else
COMPREPLY=($(compgen -f -- ${arg}))
fi
}
function _roscomplete_rosservice {
COMPREPLY=()
arg="${COMP_WORDS[COMP_CWORD]}"
if [[ $COMP_CWORD == 1 ]]; then
opts="list call type find uri"
COMPREPLY=($(compgen -W "$opts" -- ${arg}))
else
COMPREPLY=($(compgen -f -- ${arg}))
fi
}
complete -F "_roscomplete_sub_dir" -o "nospace" "roscd"
@ -316,3 +364,7 @@ complete -F "_roscomplete_file" "roscp"
complete -F "_roscomplete_launch" "roslaunch"
complete -F "_roscomplete" -o "nospace" "rosupdate"
complete -F "_roscomplete_rosbag" "rosbag"
complete -F "_roscomplete_rosnode" "rosnode"
complete -F "_roscomplete_rosparam" "rosparam"
complete -F "_roscomplete_rostopic" "rostopic"
complete -F "_roscomplete_rosservice" "rosservice"