Merge branch '2.3' into 2.4
This commit is contained in:
@ -14,6 +14,7 @@
|
|||||||
var fs = require('fs')
|
var fs = require('fs')
|
||||||
var program = require('yargs');
|
var program = require('yargs');
|
||||||
var inquirer = require('inquirer')
|
var inquirer = require('inquirer')
|
||||||
|
var readlineSync = require('readline-sync')
|
||||||
|
|
||||||
// Note: The version.js file is generated at configuation time. If you are
|
// Note: The version.js file is generated at configuation time. If you are
|
||||||
// building in-source, manually create the file
|
// building in-source, manually create the file
|
||||||
@ -121,6 +122,20 @@ program
|
|||||||
.demandCommand(1, 'At least one command is required')
|
.demandCommand(1, 'At least one command is required')
|
||||||
.command('*', 'the default command', {}, function(argv) {
|
.command('*', 'the default command', {}, function(argv) {
|
||||||
if (argv._.length == 0) {
|
if (argv._.length == 0) {
|
||||||
|
|
||||||
|
// No password given, ask it from the command line
|
||||||
|
// TODO: Combine this into the one in common.js
|
||||||
|
if (argv.password == '') {
|
||||||
|
if (process.stdin.isTTY) {
|
||||||
|
argv.password = readlineSync.question('Enter password: ', {
|
||||||
|
hideEchoBack: true
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
var line = fs.readFileSync(0)
|
||||||
|
argv.password = line.toString().trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
base_opts = ['--user=' + argv.user,
|
base_opts = ['--user=' + argv.user,
|
||||||
'--password=' + argv.password,
|
'--password=' + argv.password,
|
||||||
'--hosts=' + argv.hosts,
|
'--hosts=' + argv.hosts,
|
||||||
|
Reference in New Issue
Block a user