Add remaining commands

This commit is contained in:
Andrew Miner
2016-04-15 21:22:10 -07:00
parent 31f6e12844
commit 9ddbd5cda7
14 changed files with 417 additions and 54 deletions
@@ -55,6 +55,14 @@ module.exports = class ParserExtension
return false
incompatibleField: (command, obj, field, otherCommandName)->
otherCommandName ?= field
if obj[field]?
@data.addError "#{command.name} cannot be used with #{otherCommandName}"
return true
return false
missingCurrent: (command, type)->
obj = @data.getCurrent type
if not obj?
@@ -77,6 +85,13 @@ module.exports = class ParserExtension
return false
invalidVerb: (command, verb)->
if not verb in ['mod', 'item']
@data.addError command, "#{command.name} only applies to either `mod` or `item`"
return true
return false
tooFewArguments: (command, minimum)->
if command.args.length < minimum
@data.addError command, "#{command.name} requires at least #{minimum} arguments"