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
@@ -22,12 +22,8 @@ module.exports = class HatCommand extends Command {
{
key: 'type',
prompt: `What type of hat would you like to use? Either ${list(hats, 'or')}.`,
type: 'string',
validate: type => {
if (hats.includes(type.toLowerCase())) return true;
return `Invalid type, please enter either ${list(hats, 'or')}.`;
},
parse: type => type.toLowerCase()
type: 'choice',
choices: hats
},
{
key: 'user',