choice argument type

This commit is contained in:
Daniel Odendahl Jr
2018-03-17 13:02:45 +00:00
parent 7c12d04e42
commit 679bb538cb
17 changed files with 84 additions and 121 deletions
+2 -6
View File
@@ -14,12 +14,8 @@ module.exports = class BinaryCommand extends Command {
{
key: 'mode',
prompt: `Would you like to ${list(modes, 'or')}?`,
type: 'string',
validate: mode => {
if (modes.includes(mode.toLowerCase())) return true;
return `Invalid mode, please enter either ${list(modes, 'or')}.`;
},
parse: mode => mode.toLowerCase()
type: 'choice',
choices: modes
},
{
key: 'text',