diff --git a/src/cligen/command/argument.cr b/src/cligen/command/argument.cr index 8203c92..c374712 100644 --- a/src/cligen/command/argument.cr +++ b/src/cligen/command/argument.cr @@ -1,6 +1,6 @@ module CliGen class Command - macro argument(variable, description, long = nil, short = nil, validation = nil, on_match = nil, def_setter = false, def_getter = false, options = nil, delimiter = ",", format = nil) + macro argument(variable, description, long = nil, short = nil, validation = nil, on_match = nil, def_setter = false, def_getter = false, options = nil, delimiter = ",", format = nil, allow_no_verification = false) {% raise "ERROR : CliGen::Command.argument : def_setter must be a Bool" unless def_setter.is_a? BoolLiteral %} {% raise "ERROR : CliGen::Command.argument : First argument (#{variable}) must be a TypeDeclaration (ex: ' : [= val]')" unless variable.is_a? TypeDeclaration %} {% name = variable.var %} @@ -45,7 +45,7 @@ module CliGen {% format = format.resolve if format.is_a? Path %} {% raise "ERROR : CliGen::Command.argument(#{name}) : Provided format must be a RegexLiteral" unless format.is_a? RegexLiteral %} {% end %} - {% if type.resolve <= Array %} + {% if type.resolve <= Array && ! allow_no_verification %} {% elem = type.type_vars.first %} {% unless elem == Int32 %} {% if format.nil? && options.nil? %}