erikhuda/thor — pull request #359 by lucas-heinlen (2013-08-08 20:43:45+00:00)
Title: Fixes #285 - Process a command's options when it is executed with invoke

I ran into the same issue as #285 and, after some digging around, I found the following. In the case that the options were pre-parsed and coming in as a hash (as they do on invoke), the command's options were not being merged into the options to be parsed. After reviewing some of the surrounding code, it seemed appropriate to move the command options merge outside of the single if branch as well. I'm not extremely familiar with the code, so, hopefully, I did not miss some reason that this was not proper. All of the existing tests continued to pass after this small change and the new test I wrote to expose the issue also passed afterwards.