I'm having trouble getting the demand method in Optimist to work.
The docs say "If key is a string, show the usage information and exit
if key wasn't specified in process.argv."

Here's a simple example from a file named demand.js:

var optimist = require('optimist');
optimist.usage('usage: ./demand.js --foo [bar]');
optimist.demand(['foo']);
var argv = optimist.argv;
console.log('foo =', argv.foo);

When I enter "node demand.js" I get "foo = undefined".
I think it should output the usage string instead since I told it that
foo is a required option using the demand method.

-- 
R. Mark Volkmann
Object Computing, Inc.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to