visionmedia/commander.js — Issue #36: stdin is not initialized: program.password() fails
Author: floriancargoet
Created: 2011-12-16 13:49:17+00:00
State: open

Error
-----
Using `program.password()` I get the following error:

AssertionError: stdin must be initialized before calling setRawMode
at Object.setRawMode (tty.js:37:10)
at Command.password ([...]/node_modules/commander/lib/commander.js:844:7)
[...]

You can reproduce it by executing the password example in `examples/`.

Workaround
----------
From the docs : http://nodejs.org/docs/v0.6.6/api/all.html#stream.resume
"The stdin stream is paused by default, so one must call process.stdin.resume() to read from it."

Adding `process.stdin.resume()` before `program.password()` works.

Version info
------------
Node: 0.6.6
Commander: 0.5.0