rburns / ansi-to-html

Convert ansi escaped text streams to html.
MIT License
357 stars 48 forks source link

cli #23

Closed monsterkodi closed 8 years ago

monsterkodi commented 8 years ago

hello, this adds simple command line ability (either piped in or reading from a file)

rburns commented 8 years ago

Hi, Thanks for putting this together. I think I'd rather not commit JS to git. It does, however, get published to npm. I've added some suggestions in-line on the pull request patch. Let me know if this approach is problematic. I'm unfamiliar with publishing compiled command line tools on npm (if it's different than library code)

...

looking a bit closer, I think the coffee task in the gruntfile would need to be modified to support that approach.

monsterkodi commented 8 years ago

Hi rburns, thanks for considering this. Yes, it is possible to exclude js files from git but still have them included in the npm package. Having a command line tool in addition to the module in one package is not a problem. It is just a matter of adding the file that handles the command line arguments and point to it in the "bin" entry in the package.json. I am totally fine with any renaming or other changes. Just let me know if you expect me to do anything and I will do it.

rburns commented 8 years ago

Thanks, looks good.

For the stream option, I think enabled is correct. I had put that behind on option with the intention of making it default enabled after any possible bugs were fixed. I'm not aware that there were/are any.

I'd like to support taking input from stdin on the command line. and exposing some selection of the available options on the command line, as well. I can look into doing that. Or, feel free if you are interested.

monsterkodi commented 8 years ago

hi, support for stdin is already in. setting the options from the comand line is also in (commit 03f458d from 2 days ago). yours kodi

monsterkodi commented 8 years ago

well, i don't know what you mean exactly with "taking input from stdin on the command line". what works is piping, e.g.: cat file | ansi-to-html

monsterkodi commented 8 years ago

Thanks for merging my pull request. I would appreciate if you dropped me a note once it's published on npm. Thanks again, yours kodi

rburns commented 8 years ago

@monsterkodi Sorry for the delay, Have published a new release.

monsterkodi commented 8 years ago

no problem :-) thanks for the release.