New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a built-in CLI handler for startup arguments (--squirel-*) #44
Comments
Maybe? Send a PR :) |
I can do that :) The only thing that still bothers me is where to put that code. I'm still uncomfortable with putting everything in |
I would put this in a separate class, yeah - it's not a context though, just make a simple static class + method that will parse arguments and return an Enum |
Well, I thought of something like this, since first-run and install both require startup arguments:
So if we're to have such a class, why not make it so that it also handles creating the data directories (since that's the typical job of But my main reason is that I'm a TDD-maniac, and if I'm to introduce a dependency in my app, I'd like to be able to mock it. Static methods just make my life harder :) Anyway, I can just send a PR and let you decide what to do with it :) |
I'm not super excited about that, let's leave that in UpdateManager.
This method has no state though, what is there to mock? You pass in arguments, it does a thing |
It's your project :) As for TDD, I'll end up wrapping it in a class anyway since I don't want to simulate Squirrel's logic in my app, I just want to simulate a state. My test would then look something like:
rather than passing the actual squirrel arguments. But that's just my own way of working, I won't push it on you! |
#72 should cover this |
Since most apps will want/need to handle the
--squirrel-*
startup arguments, I suggest you provide a built-in handler for that. e.g.:(Just as an example of the idea).
What do you think? I can provide my implementation back as a pull request if you want.
The text was updated successfully, but these errors were encountered: