Closed Floby closed 12 years ago
This is much more full-featured than the utility I provided - +1 to this pull request.
Yeah. Yours can read from stdin though. I should try and make it do that too.
Ah, I missed that. Yes, reading from stdin is pretty important for my use case.
Just have at it. I won't be able to play with this just now. So if you want to add it, do it. It shouldn't be really hard. the option parser i used is here https://github.com/substack/node-optimist the readme should be enough for you to get how it works.
On 12 January 2012 17:19, Tom Stuart < reply@reply.github.com
wrote:
Ah, I missed that. Yes, reading from stdin is pretty important for my use case.
Reply to this email directly or view it on GitHub: https://github.com/DanielRapp/twss.js/pull/3#issuecomment-3465774
I can't work out how to get to stdin when using optimist, or possibly something else in this version of the executable. Calling stdin.resume() followed by stdin.on() appears not to have any effect. Over to you @Floby?
Optimist is just an option parser. You should be able to get stdin as usual.
Yes, that ought to be true, but doesn't appear to be. If I get around to it, I'll try to produce a minimal test case and report it upstream/fix it. In the mean time, feel free to try where I have failed.
I just added a small script in a bin/ folder which is installed by npm when the package is installed globally. it doesn't have a lot of features yet but it does the job.