How to use the prompt function from commander
Find comprehensive JavaScript commander.prompt code examples handpicked from public code repositorys.
GitHub: spmjs/spm2
6 7 8 9 10 11 12 13 14 15
module.exports = function(options) { var pkg = iduri.resolve(options.query); if (!pkg.version) { commander.prompt(' are you sure to delete all versions? (y/N) ', function(sure) { console.log(); if (sure.charAt(0).toLowerCase() === 'y') { unpublish(options, pkg); } else {
26
126
26
+ 3 other calls in file
GitHub: spmjs/spm2
18 19 20 21 22 23 24 25 26 27
}); }; function register(options) { commander.prompt({ username: ' username: ', email: ' email: ' }, function(info) { commander.password(' password: ', function(password) {
26
126
26
+ 23 other calls in file
148 149 150 151 152 153 154 155 156 157
if (!auth) { prompt.user = 'Enter your saucelab\'s username: '; prompt.key = 'Enter your saucelab\'s access key: '; } program.prompt(prompt, function(obj) { auth = auth || obj.user + ':' + obj.key; browsers = browsers || obj.browsers; // auth
9
99
6
GitHub: projectkudu/KuduExec
37 38 39 40 41 42 43 44 45 46
}); } function askUserName(callback) { if (!username) { commander.prompt('Enter user name: ', function (data) { username = data; callback(); }); }
4
15
32
+ 7 other calls in file
GitHub: pj4533/lightman
9 10 11 12 13 14 15 16 17 18
} }); } var login = function (callback) { program.prompt('Username: ', function(username){ program.password('Password: ', '*', function(password){ keychain.setPassword({ account: 'lightmanUsername', service: 'lightman', password: username }, function(err) { keychain.setPassword({ account: 'lightmanPassword', service: 'lightman', password: password }, function(err) { process.stdin.destroy();
3
4
1
commander.Option is the most popular function in commander (1786 examples)