Typo: marge -> merge
This commit is contained in:
parent
668a1e8371
commit
ab0806ee61
1 changed files with 19 additions and 19 deletions
|
@ -465,10 +465,10 @@ function escapePattern(pattern) {
|
||||||
function(s) { return '\\x' + ('00' + s.charCodeAt().toString(16)).substr(-2); });
|
function(s) { return '\\x' + ('00' + s.charCodeAt().toString(16)).substr(-2); });
|
||||||
}
|
}
|
||||||
|
|
||||||
// margeOptions(options1, options2 ... )
|
// mergeOptions(options1, options2 ... )
|
||||||
// margeOptions(true, options1, options2 ... )
|
// mergeOptions(true, options1, options2 ... )
|
||||||
// arg1=true : Start from defaultOptions and pick elements of that.
|
// arg1=true : Start from defaultOptions and pick elements of that.
|
||||||
function margeOptions() {
|
function mergeOptions() {
|
||||||
var optionsList = Array.prototype.slice.call(arguments),
|
var optionsList = Array.prototype.slice.call(arguments),
|
||||||
optionNames, fromDefault;
|
optionNames, fromDefault;
|
||||||
|
|
||||||
|
@ -848,27 +848,27 @@ exports._DBG_clearHistory = function() { lastInput = ''; inputHistory = []; };
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
|
|
||||||
exports.setDefaultOptions = function(options) {
|
exports.setDefaultOptions = function(options) {
|
||||||
defaultOptions = margeOptions(true, options);
|
defaultOptions = mergeOptions(true, options);
|
||||||
return margeOptions(true); // copy
|
return mergeOptions(true); // copy
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.question = function(query, options) {
|
exports.question = function(query, options) {
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
return getValidLine(margeOptions(margeOptions(true, options), {
|
return getValidLine(mergeOptions(mergeOptions(true, options), {
|
||||||
display: query
|
display: query
|
||||||
}));
|
}));
|
||||||
/* eslint-enable key-spacing */
|
/* eslint-enable key-spacing */
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.prompt = function(options) {
|
exports.prompt = function(options) {
|
||||||
var readOptions = margeOptions(true, options);
|
var readOptions = mergeOptions(true, options);
|
||||||
readOptions.display = readOptions.prompt;
|
readOptions.display = readOptions.prompt;
|
||||||
return getValidLine(readOptions);
|
return getValidLine(readOptions);
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.keyIn = function(query, options) {
|
exports.keyIn = function(query, options) {
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
var readOptions = margeOptions(margeOptions(true, options), {
|
var readOptions = mergeOptions(mergeOptions(true, options), {
|
||||||
display: query,
|
display: query,
|
||||||
keyIn: true,
|
keyIn: true,
|
||||||
keepWhitespace: true
|
keepWhitespace: true
|
||||||
|
@ -906,7 +906,7 @@ exports.keyIn = function(query, options) {
|
||||||
exports.questionEMail = function(query, options) {
|
exports.questionEMail = function(query, options) {
|
||||||
if (query == null) { query = 'Input e-mail address: '; }
|
if (query == null) { query = 'Input e-mail address: '; }
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
return exports.question(query, margeOptions({
|
return exports.question(query, mergeOptions({
|
||||||
// -------- default
|
// -------- default
|
||||||
hideEchoBack: false,
|
hideEchoBack: false,
|
||||||
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address
|
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address
|
||||||
|
@ -925,7 +925,7 @@ exports.questionEMail = function(query, options) {
|
||||||
exports.questionNewPassword = function(query, options) {
|
exports.questionNewPassword = function(query, options) {
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
var resCharlist, min, max,
|
var resCharlist, min, max,
|
||||||
readOptions = margeOptions({
|
readOptions = mergeOptions({
|
||||||
// -------- default
|
// -------- default
|
||||||
hideEchoBack: true,
|
hideEchoBack: true,
|
||||||
mask: '*',
|
mask: '*',
|
||||||
|
@ -988,7 +988,7 @@ function _questionNum(query, options, parser) {
|
||||||
return !isNaN(validValue) && typeof validValue === 'number';
|
return !isNaN(validValue) && typeof validValue === 'number';
|
||||||
}
|
}
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
exports.question(query, margeOptions({
|
exports.question(query, mergeOptions({
|
||||||
// -------- default
|
// -------- default
|
||||||
limitMessage: 'Input valid number, please.'
|
limitMessage: 'Input valid number, please.'
|
||||||
}, options, {
|
}, options, {
|
||||||
|
@ -1011,7 +1011,7 @@ exports.questionPath = function(query, options) {
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
var error = '',
|
var error = '',
|
||||||
validPath, // before readOptions
|
validPath, // before readOptions
|
||||||
readOptions = margeOptions({
|
readOptions = mergeOptions({
|
||||||
// -------- default
|
// -------- default
|
||||||
hideEchoBack: false,
|
hideEchoBack: false,
|
||||||
limitMessage: '$<error(\n)>Input valid path, please.' +
|
limitMessage: '$<error(\n)>Input valid path, please.' +
|
||||||
|
@ -1142,7 +1142,7 @@ function getClHandler(commandHandler, options) {
|
||||||
|
|
||||||
exports.promptCL = function(commandHandler, options) {
|
exports.promptCL = function(commandHandler, options) {
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
var readOptions = margeOptions({
|
var readOptions = mergeOptions({
|
||||||
// -------- default
|
// -------- default
|
||||||
hideEchoBack: false,
|
hideEchoBack: false,
|
||||||
limitMessage: 'Requested command is not available.',
|
limitMessage: 'Requested command is not available.',
|
||||||
|
@ -1162,7 +1162,7 @@ exports.promptCL = function(commandHandler, options) {
|
||||||
|
|
||||||
exports.promptLoop = function(inputHandler, options) {
|
exports.promptLoop = function(inputHandler, options) {
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
var readOptions = margeOptions({
|
var readOptions = mergeOptions({
|
||||||
// -------- default
|
// -------- default
|
||||||
hideEchoBack: false,
|
hideEchoBack: false,
|
||||||
trueValue: null,
|
trueValue: null,
|
||||||
|
@ -1177,7 +1177,7 @@ exports.promptLoop = function(inputHandler, options) {
|
||||||
|
|
||||||
exports.promptCLLoop = function(commandHandler, options) {
|
exports.promptCLLoop = function(commandHandler, options) {
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
var readOptions = margeOptions({
|
var readOptions = mergeOptions({
|
||||||
// -------- default
|
// -------- default
|
||||||
hideEchoBack: false,
|
hideEchoBack: false,
|
||||||
limitMessage: 'Requested command is not available.',
|
limitMessage: 'Requested command is not available.',
|
||||||
|
@ -1200,7 +1200,7 @@ exports.promptCLLoop = function(commandHandler, options) {
|
||||||
|
|
||||||
exports.promptSimShell = function(options) {
|
exports.promptSimShell = function(options) {
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
return exports.prompt(margeOptions({
|
return exports.prompt(mergeOptions({
|
||||||
// -------- default
|
// -------- default
|
||||||
hideEchoBack: false,
|
hideEchoBack: false,
|
||||||
history: true
|
history: true
|
||||||
|
@ -1224,7 +1224,7 @@ function _keyInYN(query, options, limit) {
|
||||||
query = query.replace(/\s*:?\s*$/, '') + ' [y/n]: ';
|
query = query.replace(/\s*:?\s*$/, '') + ' [y/n]: ';
|
||||||
}
|
}
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
res = exports.keyIn(query, margeOptions(options, {
|
res = exports.keyIn(query, mergeOptions(options, {
|
||||||
// -------- forced
|
// -------- forced
|
||||||
hideEchoBack: false,
|
hideEchoBack: false,
|
||||||
limit: limit,
|
limit: limit,
|
||||||
|
@ -1246,7 +1246,7 @@ exports.keyInPause = function(query, options) {
|
||||||
query = query.replace(/\s+$/, '') + ' (Hit any key)';
|
query = query.replace(/\s+$/, '') + ' (Hit any key)';
|
||||||
}
|
}
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
exports.keyIn(query, margeOptions({
|
exports.keyIn(query, mergeOptions({
|
||||||
// -------- default
|
// -------- default
|
||||||
limit: null
|
limit: null
|
||||||
}, options, {
|
}, options, {
|
||||||
|
@ -1261,7 +1261,7 @@ exports.keyInPause = function(query, options) {
|
||||||
|
|
||||||
exports.keyInSelect = function(items, query, options) {
|
exports.keyInSelect = function(items, query, options) {
|
||||||
/* eslint-disable key-spacing */
|
/* eslint-disable key-spacing */
|
||||||
var readOptions = margeOptions({
|
var readOptions = mergeOptions({
|
||||||
// -------- default
|
// -------- default
|
||||||
hideEchoBack: false
|
hideEchoBack: false
|
||||||
}, options, {
|
}, options, {
|
||||||
|
|
Loading…
Reference in a new issue