Skip to content

Commit

Permalink
fix(validator): fix handling of prog.LIST flag (#43)
Browse files Browse the repository at this point in the history
Fixes #39
  • Loading branch information
mattallty authored Apr 7, 2017
1 parent 0d1bd54 commit d1e429a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/pizza/pizza.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ prog

// --extra will be auto-magicaly autocompleted by providing the user with 3 choices
.option('-e <ingredients>', 'Add extra ingredients', ['pepperoni', 'onion', 'cheese'])
.option('--add-ingredients <ingredients>', 'Add extra ingredients', prog.LIST)
.action(function(args, options, logger) {
logger.info("Command 'order' called with:");
logger.info("arguments: %j", args);
logger.info("options: %j", options);
})



// the "return" command
.command('return', 'Return an order')
// <kind> will be auto-magicaly autocompleted by providing the user with 3 choices
Expand Down
2 changes: 2 additions & 0 deletions lib/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ class Validator {
return !(value === '0' || value === 'no' || value === 'false');
}
}

return value;
}

/**
Expand Down

0 comments on commit d1e429a

Please sign in to comment.