Closed white-gecko closed 2 years ago
Close #37 .
How do you like this implementation for multiple selection states? For sure the code could be more elegant, but it works and preserves the old behavior.
Usage example:
const inquirer = require('inquirer') const inquirerFileTreeSelection = require('inquirer-file-tree-selection-prompt') const figures = require('figures'); inquirer.registerPrompt('file-tree-selection', inquirerFileTreeSelection) inquirer .prompt([ { type: 'file-tree-selection', name: 'file', multiple: true, states: [{state: 'ignored', label: 'i'}, {state: 'selected', label: figures.radioOn}] } ]) .then(answers => { console.log(JSON.stringify(answers)) });
will result in output like
{"file":{"/home/…/file.log":"ignored","/home/…/node_modules":"selected"}}
Close #37 .
How do you like this implementation for multiple selection states? For sure the code could be more elegant, but it works and preserves the old behavior.
Usage example:
will result in output like