On 08/24/10 07:18 PM, Tim Foster wrote:
Hi All,
I'd appreciate a code review for this fix which breaks up the pkg usage
message so that "--help" with a single subcommand only prints usage for
that subcommand.
This change also prints the subcommand usage whenever we get an invalid
option for a valid subcommand, rather than telling us to consult the
full usage message.
http://cr.opensolaris.org/~timf/12723-usage-webrev
( Is breaking the 80 char limit ok here? I felt it was easier to read
this way, occasionally going over the margin, than using """ )
The pkglint wad adds capture of stderr to the test suite, so if that
gets back before this changeset, I'll also enhance t_pkg_help.py to
verify that only the given subcommand usage is printed when "pkg
<subcommand> --help" is run.
I've added some tests, and verified that a diff of the usage message
produced by the current gate vs. the one this changeset produces are
identical (modulo my removing some trailing whitespace on the 'pkg fix'
and 'pkg uninstall' usage lines)
src/client.py:
line 4124: indent should match up with 'cmds' above
I'm not sure I agree with having help exit with 2. An exit code of 2
implies an error, but if the user specifically asked for help, why would
we exit with an error? Clearly, we did what the user asked for.
Otherwise, seems reasonable.
-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss