From 47df89a6c1a8505be407a77ed6d11886f5801e22 Mon Sep 17 00:00:00 2001 From: Tristan Ancelet Date: Tue, 11 Aug 2026 11:58:04 -0500 Subject: [PATCH] Had to fix the selection macro. Was part of the way throught and skipped finishing it --- src/cligen/command/selection.cr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cligen/command/selection.cr b/src/cligen/command/selection.cr index 6001413..85d0352 100644 --- a/src/cligen/command/selection.cr +++ b/src/cligen/command/selection.cr @@ -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 description" unless description %} {% 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 %} - {% raise "ERROR : CliGen::Command.selection : Provided options must be " unless options. %} + {% options = options.resolve if options.is_a? Path %} + {% 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}})] @{{variable}}