Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 10, 2017

Conversation

javierdiazp
Copy link
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
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

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
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
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
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
Member

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

@mikepurvis mikepurvis changed the base branch from indigo-devel to kinetic-devel January 10, 2017 20:21
@mikepurvis
Copy link
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
Member

@ros-pull-request-builder retest this please

Copy link
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
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

@@ -712,7 +712,8 @@ def fullusage(mode):
return """%(cmd)s is a command-line tool for displaying information about ROS %(type_)s types.

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
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
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
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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants