visionmedia/commander.js — pull request #34 by martypdx (2011-12-07 06:46:09+00:00)
Title: Added prompt tests and fixed four issues

Getting started early on my new year's resolution to figure out how to do pull requests on github, so apologies in advance if I don't know what I'm doing.

In the `promptForNumber` method there was the use of undeclared `program` versus `self`. Turned into a bit of a yak shaving to create tests which then also needed stdin and stdout to be mock. Found three other issues along the way:

1) Supplemental prompts for non-dates and numbers kept adding additional "(must be a xxxx)" to the prompt string

2) Node on windows returns `\r\n` so multi-line wasn't working

3) Somewhat more qualitatively I changed multi-line to not return the extra `\n` at the end, but preserved leading whitespace.