DanielRapp / twss.js

A node.js "that's what she said" classifier
MIT License
694 stars 34 forks source link

Feature CLI #3

Closed Floby closed 12 years ago

Floby commented 12 years ago

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.

rentalcustard commented 12 years ago

This is much more full-featured than the utility I provided - +1 to this pull request.

Floby commented 12 years ago

Yeah. Yours can read from stdin though. I should try and make it do that too.

rentalcustard commented 12 years ago

Ah, I missed that. Yes, reading from stdin is pretty important for my use case.

Floby commented 12 years ago

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

rentalcustard commented 12 years ago

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?

Floby commented 12 years ago

Optimist is just an option parser. You should be able to get stdin as usual.

rentalcustard commented 12 years ago

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.