Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Throw error when option value is not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneLem committed Jul 8, 2012
1 parent 933d4e2 commit 676b7d1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/skeleton/option_parser.coffee
Expand Up @@ -35,8 +35,7 @@ class OptionParser
if choices?
value = @args[index + 1]
if choices.indexOf(value) == -1 && choices[0] != ''
console.warn "Invalid value “#{value}” for #{flag} option"
process.exit()
throw new Error "Invalid value “#{value}” for #{flag} option"
else
value = true

Expand Down

0 comments on commit 676b7d1

Please sign in to comment.