arunoda/laika — pull request #42 by ejoubaud (2013-07-29 12:04:13+00:00)
Title: Fix unflagged arguments parsing for `laika.opts`

This should fix the bug shipped with #41. The call to `optimist#parse` was overriding its `argv`.

The `slice` fix is a bit hacky but that's what `optimist` does before passing `process.argv` to `#parse`. That part is private, so I'm left with no DRY solution, unless we prefer to refactor `optimist` and send a PR there.

I looked into adding a regression test but it would take a bit of refactoring to make this file more test-friendly. Let me know if you prefer me to do that before we consider merging.