Comparing version 0.10.1 to 0.11.0
@@ -22,6 +22,8 @@ 'use strict'; | ||
this.value = val; | ||
this.short = val; | ||
} else { | ||
_.extend(this, val, { | ||
name: val.name || val.value, | ||
value: val.hasOwnProperty('value') ? val.value : val.name | ||
value: val.hasOwnProperty('value') ? val.value : val.name, | ||
short: val.short || val.name || val.value | ||
}); | ||
@@ -28,0 +30,0 @@ } |
'use strict'; | ||
var assert = require('assert'); | ||
var _ = require('lodash'); | ||
var chalk = require('chalk'); | ||
var Separator = require('./separator'); | ||
@@ -6,0 +5,0 @@ var Choice = require('./choice'); |
@@ -10,4 +10,2 @@ /** | ||
var ansiRegex = require('ansi-regex'); | ||
var readline = require('readline'); | ||
var cliWidth = require('cli-width'); | ||
var runAsync = require('run-async'); | ||
@@ -14,0 +12,0 @@ var Choices = require('../objects/choices'); |
@@ -12,3 +12,2 @@ /** | ||
var observe = require("../utils/events"); | ||
var utils = require("../utils/readline"); | ||
var Paginator = require("../utils/paginator"); | ||
@@ -140,3 +139,3 @@ | ||
this.selection = _.pluck(choices, "name"); | ||
this.selection = _.pluck(choices, "short"); | ||
return _.pluck(choices, "value"); | ||
@@ -143,0 +142,0 @@ }; |
@@ -5,3 +5,2 @@ /** | ||
var _ = require("lodash"); | ||
var util = require("util"); | ||
@@ -8,0 +7,0 @@ var chalk = require("chalk"); |
@@ -12,3 +12,2 @@ /** | ||
var observe = require("../utils/events"); | ||
var utils = require("../utils/readline"); | ||
var Paginator = require("../utils/paginator"); | ||
@@ -96,3 +95,3 @@ | ||
if ( this.status === "answered" ) { | ||
message += chalk.cyan( this.opt.choices.getChoice(this.selected).name ); | ||
message += chalk.cyan( this.opt.choices.getChoice(this.selected).short ); | ||
} else { | ||
@@ -99,0 +98,0 @@ var choicesStr = listRender(this.opt.choices, this.selected ); |
@@ -5,3 +5,2 @@ /** | ||
var _ = require("lodash"); | ||
var util = require("util"); | ||
@@ -8,0 +7,0 @@ var chalk = require("chalk"); |
'use strict'; | ||
var _ = require('lodash'); | ||
var util = require('./readline'); | ||
var readline = require('readline'); | ||
var cliWidth = require('cli-width'); | ||
var stripAnsi = require('strip-ansi'); | ||
// Prevent crashes on environments where the width can't be properly detected | ||
cliWidth.defaultWidth = 80; | ||
@@ -9,0 +10,0 @@ var ScreenManager = module.exports = function (rl) { |
{ | ||
"name": "inquirer", | ||
"version": "0.10.1", | ||
"version": "0.11.0", | ||
"description": "A collection of common interactive command line user interfaces.", | ||
@@ -5,0 +5,0 @@ "main": "lib/inquirer.js", |
@@ -15,3 +15,3 @@ Inquirer.js | ||
**`Inquirer.js`** should ease the process of | ||
**`Inquirer.js`** should ease the process of | ||
- providing *error feedback* | ||
@@ -73,3 +73,3 @@ - *asking questions* | ||
- **choices**: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers. | ||
Array values can be simple `strings`, or `objects` containing a `name` (to display) and a `value` properties (to save in the answers hash). Values can also be [a `Separator`](#separator). | ||
Array values can be simple `strings`, or `objects` containing a `name` (to display in list), a `value` (to save in the answers hash) and a `short` (to display after selection) properties. The choices array can also contain [a `Separator`](#separator). | ||
- **validate**: (Function) Receive the user input and should return `true` if the value is valid, and an error message (`String`) otherwise. If `false` is returned, a default error message is provided. | ||
@@ -76,0 +76,0 @@ - **filter**: (Function) Receive the user input and return the filtered value to be used inside the program. The value returned will be added to the _Answers_ hash. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62216
1684