erikhuda/thor — pull request #374 by teeniimoodi (2013-12-03 09:33:39+00:00)
Title: Fix dispatching of subcommands (concerning :help and *args) (#306)

This commit fixes #306.

If a subcommand had a default_command, its help would not be accessible. Instead, the help of the subcommand's help would be shown, e.g. `cmd sub help` would call `SUB#help('help')`.

Reason: the obfuscated code in `Thor.dispatch`. All commands of a subcommand (except for the default_command) would receive themselves as first argument, e.g. `cmd sub foo` would call `SUB#foo('foo')`.

See the deleted/added comments in `Thor.dispatch` and the specs for details.