Had to fix the selection macro. Was part of the way throught and skipped finishing it

This commit is contained in:
Tristan Ancelet
2026-08-11 11:58:04 -05:00
parent afd7ba7c7b
commit 47df89a6c1
+3 -2
View File
@@ -7,8 +7,9 @@ module CliGen
{% raise "ERROR : CliGen::Command.selection : You must provide a short or long" unless long || short %} {% raise "ERROR : CliGen::Command.selection : You must provide a short or long" unless long || short %}
{% raise "ERROR : CliGen::Command.selection : You must provide a description" unless description %} {% raise "ERROR : CliGen::Command.selection : You must provide a description" unless description %}
{% raise "ERROR : CliGen::Command.selection : Provided description must be a String" unless description.is_a? StringLiteral %} {% raise "ERROR : CliGen::Command.selection : Provided description must be a String" unless description.is_a? StringLiteral %}
{% raise "ERROR : CliGen::Command.selection : You must provide options" unless options.is_a? ArrayLiteral %} {% options = options.resolve if options.is_a? Path %}
{% raise "ERROR : CliGen::Command.selection : Provided options must be " unless options. %} {% raise "ERROR : CliGen::Command.selection : Provided options must be an ArrayLiteral" unless options.is_a? ArrayLiteral %}
{% raise "ERROR : CliGen::Command.selection : Provided options must be of the same type as the variable" unless options.of == variable.type %}
@[CliGen::Argument(short: {{short}}, long: {{long}}, description: {{description}}, validation: {{validation}}, on_match: {{on_match}})] @[CliGen::Argument(short: {{short}}, long: {{long}}, description: {{description}}, validation: {{validation}}, on_match: {{on_match}})]
@{{variable}} @{{variable}}