Open zrewald opened 4 years ago
I believe this only works when you have def hello(*params)
. It won't work when you have def hello
. With *params you're effectively saying "Send any additional input to the method for this command. I want to use them for something.". Given that, it's a bit strange to wonder why the framework is doing what you're telling it to do.
🌈 (Not sure if that's needed for issues, but whatever)
Hey, All.
I was giving Thor a test run, and noticed that options that are not specified for a method are included in the parameters passed to it.
Version deets:
Here's a basic file that will cause the issue (com_test.rb):
Results:
Here's where things get weird.
What is the reasoning behind this behavior, as opposed to silently ignoring the extra option or throwing an exception?
I took a glance through the docs for anything regarding a situation like this, but came up empty-handed. Apologies if this is clearly spelled out somewhere in there.
Thanks!