-
Notifications
You must be signed in to change notification settings - Fork 8
/
interactive.js
executable file
路43 lines (36 loc) 路 1.17 KB
/
interactive.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const inquirer = require('suman-inquirer');
const util = require('util');
inquirer.prompt([
{
type: 'checkbox',
message: 'Select any command line options (use spacebar)',
name: 'command-line-options',
choices: [
{
name: '--verbose, [type = arrayOfBool], (Verbose output. Use multiple times for more verbose.)',
checked: true
},
{
name: '--sparse, [type = bool], (Sparse output. Less verbose than standard.)',
checked: true
},
{
name: '--match-any, [type = arrayOfString], (Use this to filter input to match the given JS regex)',
checked: true
},
{
name: '--match-none, [type = arrayOfString], (Use this to filter input to ignore matches of the given JS regex)',
checked: true
},
{
name: '--match-all, [type = arrayOfString], (Use this to filter input to ignore matches of the given JS regex)',
checked: true
}
],
filter: function (val) { // <<< add this function
return String(val).split(',')[ 0 ];
},
}
]).then(function (answers) {
console.log('\n\n\nanswers => ' + util.inspect(answers));
});