Revert "choice argument type"

This reverts commit 679bb538cb.
This commit is contained in:
Daniel Odendahl Jr
2018-03-17 13:22:07 +00:00
parent 12e8af1e92
commit d74e2c9d96
17 changed files with 121 additions and 84 deletions
+12 -4
View File
@@ -16,14 +16,22 @@ module.exports = class CurrencyCommand extends Command {
{
key: 'base',
prompt: `What currency code do you want to use as the base? Either ${list(codes, 'or')}.`,
type: 'choice',
choices: codes
type: 'string',
validate: base => {
if (codes.includes(base.toUpperCase())) return true;
return `Invalid base, please enter either ${list(codes, 'or')}.`;
},
parse: base => base.toUpperCase()
},
{
key: 'target',
prompt: `What currency code do you want to convert to? Either ${list(codes, 'or')}.`,
type: 'choice',
choices: codes
type: 'string',
validate: target => {
if (codes.includes(target.toUpperCase())) return true;
return `Invalid target, please enter either ${list(codes, 'or')}.`;
},
parse: target => target.toUpperCase()
},
{
key: 'amount',