cli-interact
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -14,4 +14,9 @@ //============================== | ||
answer = query(); | ||
answer = query(false); | ||
console.log('you answered:', answer); | ||
answer = query(true); | ||
console.log('you answered:', answer); |
@@ -13,3 +13,3 @@ //============================== | ||
function getChar (promptText, allowedCharsAsString) { | ||
function getChar (promptText, allowedCharsAsString, flagAllowNoAnswer) { | ||
var answer; | ||
@@ -23,2 +23,4 @@ | ||
process.exit(); | ||
} else if (flagAllowNoAnswer && (answer === '')) { | ||
break; | ||
} else { | ||
@@ -37,4 +39,4 @@ if (answer.length && (allowedCharsAsString.indexOf(answer) >= 0)) { | ||
function getIPversion () { | ||
return getChar('IP Version', '46'); | ||
function getIPversion (flagAllowNoAnswer) { | ||
return getChar('IP Version', '46', flagAllowNoAnswer); | ||
} | ||
@@ -41,0 +43,0 @@ |
{ | ||
"name": "cli-interact", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"title": "cli interact", | ||
@@ -5,0 +5,0 @@ "description": "Simple helper tools for interacting synchronously with user at command line", |
8127
180