Add remaining commands
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user