diff --git a/tools/rosbash/rosbash b/tools/rosbash/rosbash index 4d583074..be7ddb6e 100644 --- a/tools/rosbash/rosbash +++ b/tools/rosbash/rosbash @@ -282,6 +282,23 @@ function roscp { cp ${arg} ${3} } +function roscat { + local arg + if [[ $1 = "--help" ]] || [[ $# -ne 2 ]]; then + echo -e "usage: roscat [package] [file]\n\nDisplay a file content within a package." + [[ $1 = "--help" ]] && return 0 || return 1 + fi + _roscmd ${1} ${2} + [ $? -eq 1 ] && return 1 + if [[ -n ${arg} ]]; then + if [[ -z $CATTER ]]; then + cat ${arg} + else + $CATTER ${arg} + fi + fi +} + function rosawesome { alias megamaid='rosbag record' alias suck2blow='rosbag play' @@ -949,6 +966,7 @@ complete -F "_roscomplete_rosclean" "rosclean" complete -F "_roscomplete_exe" "rosrun" complete -F "_roscomplete_file" "rosed" complete -F "_roscomplete_file" "roscp" +complete -F "_roscomplete_file" "roscat" complete -F "_roscomplete_launch" -o filenames "roslaunch" complete -F "_roscomplete_test" -o filenames "rostest" complete -F "_roscomplete_rospack" "rospack" diff --git a/tools/rosbash/rosfish b/tools/rosbash/rosfish index 18b09830..87ac8083 100644 --- a/tools/rosbash/rosfish +++ b/tools/rosbash/rosfish @@ -1,3 +1,4 @@ +#alias roscat 'echo "unimplemented"' function _rossed if test (uname) = "Darwin" -o (uname) = "FreeBSD" diff --git a/tools/rosbash/rostcsh b/tools/rosbash/rostcsh index 1968364b..aabaab95 100644 --- a/tools/rosbash/rostcsh +++ b/tools/rosbash/rostcsh @@ -4,6 +4,7 @@ alias rosls 'ls `rospack find \!*`' #alias rosd 'echo "unimplemented"' #alias rospd 'echo "unimplemented"' #alias rosed 'echo "unimplemented"' +#alias roscat 'echo "unimplemented"' #alias roscmd 'echo "unimplemented"' #alias roscp 'echo "unimplemented"' diff --git a/tools/rosbash/roszsh b/tools/rosbash/roszsh index 64ff06a2..a02a0e37 100644 --- a/tools/rosbash/roszsh +++ b/tools/rosbash/roszsh @@ -263,6 +263,21 @@ function roscp { cp ${arg} ${3} } +function roscat { + local arg + if [[ $1 = "--help" ]] | [[ $# -ne 2 ]]; then + echo -e "usage: roscat [package] [file]\n\nDisplay a file content within a package." + [[ $1 = "--help" ]] && return 0 || return 1 + fi + _roscmd ${1} ${2} + [ $? -eq 1 ] && return 1 + if [[ -z $CATTER ]]; then + cat ${arg} + else + $CATTER ${arg} + fi +} + function _roscomplete { local arg opts stack_opts reply=() @@ -730,7 +745,7 @@ compctl -K "_roscomplete_sub_dir" -S / "roscd" "rospd" "rosls" compctl -K "_roscomplete_rosmake" "rosmake" compctl -x 'p[1]' -k "(check purge)" -- "rosclean" -compctl -f -x 'p[1]' -K "_roscomplete" - 'p[2]' -K _roscomplete_file -- "rosed" "roscp" +compctl -f -x 'p[1]' -K "_roscomplete" - 'p[2]' -K _roscomplete_file -- "rosed" "roscp" "roscat" compctl -f -x 'S[-]' -k '(--debug --prefix)' - 'c[-1,--prefix][-1,-p]' -h '' - 'p[1],c[-1,-d],c[-1,--debug],c[-2,-p],c[-2,--prefix]' -K "_roscomplete" - 'p[2],c[-2,-d],c[-2,--debug],c[-3,-p],c[-3,--prefix]' -K _roscomplete_exe -- "rosrun" compctl -/g '*.(launch|test)' -x 'p[1]' -K "_roscomplete" -tx - 'p[2]' -K _roscomplete_launchfile -- + -x 'S[--]' -k "(--files --args --nodes --find-node --child --local --screen --server_uri --run_id --wait --port --core --pid --dump-params)" -- "roslaunch" compctl -/g '*.(launch|test)' -x 'p[1]' -K "_roscomplete" -tx - 'p[2]' -K _roscomplete_launchfile -- + -x 'S[--]' -k "(--bare --bare-limit --bare-name --pkgdir --package)" -- "rostest"