Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

[rosmsg] Rosmsg info implemented as alias of rosmsg show#941

Merged
mikepurvis merged 2 commits intoros:kinetic-develfrom
javierdiazp:indigo-devel-rosmsg-info
Feb 10, 2017
Merged

[rosmsg] Rosmsg info implemented as alias of rosmsg show#941
mikepurvis merged 2 commits intoros:kinetic-develfrom
javierdiazp:indigo-devel-rosmsg-info

Conversation

@javierdiazp
Copy link
Copy Markdown
Contributor

All the other ros* commands use "info" to display their details, except rosmsg, which uses "show". In order to maintain consistency, the alias "rosmsg info" of "rosmsg show" was implemented.

@IanTheEngineer
Copy link
Copy Markdown
Contributor

+1 for each time I accidentally typed rosmsg info in the past ... (a lot :)

@javierdiazp javierdiazp changed the title Rosmsg info implemented as alias of rosmsg show [rosmsg] Rosmsg info implemented as alias of rosmsg show Nov 29, 2016
@jfabry
Copy link
Copy Markdown

jfabry commented Dec 1, 2016

This is joint work of Javier with @OmniSliver (credit where credit is due) as part of a course I am teaching at U. Chile. They have a blog about their work (in Spanish) here: https://javierdiazp.github.io/robotica2/

sys.exit(rosmsg_cmd_show(ext, full))
sys.exit(rosmsg_cmd_show(ext, full, 'show'))
elif command == 'info':
sys.exit(rosmsg_cmd_show(ext, full, 'info'))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible alternative:

         if command in ('show', 'info'):
            sys.exit(rosmsg_cmd_show(ext, full, command))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javierdiazp Can you please update the code with the suggestion from @mikepurvis

@mikepurvis mikepurvis changed the base branch from indigo-devel to kinetic-devel January 10, 2017 19:50
@mikepurvis mikepurvis changed the base branch from kinetic-devel to indigo-devel January 10, 2017 19:51
@mikepurvis
Copy link
Copy Markdown
Member

This should target kinetic-devel. Otherwise LGTM.

@dirk-thomas dirk-thomas changed the base branch from indigo-devel to kinetic-devel January 10, 2017 19:57
@dirk-thomas dirk-thomas changed the base branch from kinetic-devel to indigo-devel January 10, 2017 19:57
@mikepurvis
Copy link
Copy Markdown
Member

It needs to be manually cherry-picked due to the other branch changes. I'll do this now.

@mikepurvis mikepurvis force-pushed the indigo-devel-rosmsg-info branch from 36c3340 to 8e54b87 Compare January 10, 2017 20:20
@mikepurvis mikepurvis changed the base branch from indigo-devel to kinetic-devel January 10, 2017 20:21
@mikepurvis
Copy link
Copy Markdown
Member

mikepurvis commented Jan 10, 2017

@ros-pull-request-builder test this please

@dirk-thomas This is failing because Jenkins is triggering the indigo/jade jobs (which fail to merge) rather than kinetic. I believe it will pass though; my inclination is to just merge now and roll it back if there's a problem with the post-merge CI build.

@dirk-thomas
Copy link
Copy Markdown
Member

@ros-pull-request-builder retest this please

Copy link
Copy Markdown
Member

@dirk-thomas dirk-thomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please create a related PR to add the completion for this new verb: https://github.com/ros/ros/blob/58acf513dfdc056f922666820ac24aa7d25ff521/tools/rosbash/rosbash#L882

sys.exit(rosmsg_cmd_show(ext, full))
sys.exit(rosmsg_cmd_show(ext, full, 'show'))
elif command == 'info':
sys.exit(rosmsg_cmd_show(ext, full, 'info'))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javierdiazp Can you please update the code with the suggestion from @mikepurvis

Commands:
\t%(cmd)s show\tShow %(type_lower)s description
\t%(cmd)s show, %(cmd)s info
\t\t\tShow %(type_lower)s description
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest keeping the existing line and adding a new line for the alias:

\t%(cmd)s show\tShow %(type_lower)s description
\t%(cmd)s info\tAlias for %(cmd)s show

@mikepurvis
Copy link
Copy Markdown
Member

I've added a commit which addresses the review feedback, and the completion verb PR is at ros/ros#138.

mikepurvis added a commit to clearpathrobotics/ros_comm that referenced this pull request Feb 10, 2017
@mikepurvis
Copy link
Copy Markdown
Member

Output looks good:

$ rosmsg -h
rosmsg is a command-line tool for displaying information about ROS Message types.

Commands:
	rosmsg show	Show message description
	rosmsg info	Alias for rosmsg show
	rosmsg list	List all messages
	rosmsg md5	Display message md5sum
	rosmsg package	List messages in a package
	rosmsg packages	List packages that contain messages

Type rosmsg <command> -h for more detailed usage

$ rosmsg show -h
Usage: rosmsg show [options] <message type>

Options:
  -h, --help            show this help message and exit
  -r, --raw             show raw message text, including comments
  -b BAGFILE, --bag=BAGFILE
                        show message from .bag file

$ rosmsg info -h
Usage: rosmsg info [options] <message type>

Options:
  -h, --help            show this help message and exit
  -r, --raw             show raw message text, including comments
  -b BAGFILE, --bag=BAGFILE
                        show message from .bag file

$ rosmsg show Bool
[std_msgs/Bool]:
bool data

$ rosmsg info Bool
[std_msgs/Bool]:
bool data

Thanks for the contribution, @javierdiazp!

@mikepurvis mikepurvis merged commit 503adb4 into ros:kinetic-devel Feb 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants