Created
October 4, 2016 20:57
-
-
Save allenhwkim/ccffda2e35c74166671151b4921697a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node --harmony | |
var co = require('co'); | |
var prompt = require('co-prompt'); | |
var program = require('commander'); | |
program | |
.arguments('<file>') | |
.option('-u, --username <username>', 'The user to authenticate as') | |
.option('-p, --password <password>', 'The user\'s password') | |
.action(function(file) { | |
co(function *() { | |
var username = yield prompt('username: '); | |
//var password = yield prompt.password('password: '); | |
var password = yield prompt('password: '); | |
console.log('user: %s pass: %s file: %s', username, password, file); | |
}); | |
}) | |
.parse(process.argv); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment