Closed levigroker closed 9 years ago
@levigroker Sorry about the delay in responding to your pull requests, I'm just getting over the flu. You're right about this. I had a fix for #2 along with a passing test locally, but never pushed it. I'll push it to the development branch so it can go out with the next release. Thank you for working on it though.
I've updated my pull request with a couple changes. Please review.
This is a possible fix for (one aspect of) https://github.com/umjames/CLIKit/issues/2
By capturing the
remainingArguments
from theoptionParser: didEncounterNonOptionArguments:
delegate method in our delegate implementation and not directly calling the application.delegate, and then using these remaining arguments inrunWithCommandlineArguments:
to call the application.delegateapplication:isReadyToBeginExecutingWithRemainingArguments:
we gain the ability to properly callapplication: isReadyToBeginExecutingWithRemainingArguments:
under the circumstances when no non-option arguments are specified.The only thing about this fix I'm not 100% happy with is that we are relying on our own
CLIApplicationOptionParserDelegate
implementation to capture the remaining arguments from the parser, which means we must directly callself.optionParserDelegate.remainingArguments
to get the arguments. This means that as opposed to having a layer of abstraction we are now tied to theCLIApplicationOptionParserDelegate
implementation.