Skip to content

Instantly share code, notes, and snippets.

@allenhwkim
Created October 4, 2016 20:57
Show Gist options
  • Save allenhwkim/ccffda2e35c74166671151b4921697a2 to your computer and use it in GitHub Desktop.
Save allenhwkim/ccffda2e35c74166671151b4921697a2 to your computer and use it in GitHub Desktop.
#!/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