Advertisement
Guest User

Untitled

a guest
Oct 4th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #!/usr/bin/env node --harmony
  2. var co = require('co');
  3. var prompt = require('co-prompt');
  4. var program = require('commander');
  5.  
  6. program
  7. .arguments('<file>')
  8. .option('-u, --username <username>', 'The user to authenticate as')
  9. .option('-p, --password <password>', 'The user\'s password')
  10. .action(function(file) {
  11. co(function *() {
  12. var username = yield prompt('username: ');
  13. //var password = yield prompt.password('password: ');
  14. var password = yield prompt('password: ');
  15. console.log('user: %s pass: %s file: %s', username, password, file);
  16. });
  17. })
  18. .parse(process.argv);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement