wycats/thor — pull request #312 by JoshCheek (2013-03-01 10:41:03+00:00)
Title: Make error messages more helpful

When passing the wrong number of args to a command, it will now tell you
what args were passed.

This is useful in cases where it is unclear what the arguments are. For
example, we were invoking the binary from a script which was not
properly escaping the arguments that it was forwarding. This caused the
invocation `--option="1 2"` to be passed as `--option=1 2` and `2` became
an argument to the command, which took about half an hour to figure out
(plus, the hour my QA spent trying to figure it out himself before I
could look at it with him). If it had told me that it was receiving the
argument `2`, it would have been pretty clear that it was an escaping
issue.

I removed the arity from the message because in the case of optional
arguments, it would output a negative number, which is confusing for
non-rubyists.

I didn't include the signature, because 1.8.7 was listed in the
.travis.yml, and it does not have the ability to reflect on parameters.
Plus, again, if the end-user is not a rubyist, then that kind of error
message would probably be too technical. So instead, just print the
description.