leafo/moonscript — pull request #141 by cahna (2014-05-28 06:36:52+00:00)
Title: added '-o file' flag to control output name/destination

I was having trouble using `moonc -t path files...` to control where to put the compiled Lua files in one of my projects' Makefiles. This PR adds functionality similar to gcc's `-o file` to `moonc` and should be a workaround for leafo/moonscript#137

I [wrote some behavioral tests](https://github.com/cahna/moonscript/blob/moonc-behavior-tests/spec/moonc_usage_spec.moon), too, in order to verify the new feature and some existing ones, but haven't had the time to cover all use cases or fix leafo/moonscript#137 yet. I can PR the tests, but I'm not sure how you'd feel about the [CLI-like usage hack](https://github.com/cahna/moonscript/blob/moonc-behavior-tests/spec/moonc_usage_spec.moon#L32) it includes. It seems elegant enough, and would be better than adding something like a [bats](https://github.com/sstephenson/bats) dependency just for some over-zealous testing.