Modified Command.argument to let the user provide a method call for runtime learning of options value. This will let the compiler check at compile time

This commit is contained in:
Tristan Ancelet
2026-08-14 14:10:25 -05:00
parent b05f49c2e8
commit f55cc25f2d
2 changed files with 5 additions and 1 deletions
Binary file not shown.
+5 -1
View File
@@ -35,7 +35,11 @@ module CliGen
{% end %}
{% if options %}
{% options = options.resolve if options.is_a? Path %}
{% raise "ERROR : CliGen::Command.argument(#{name}) : Provided options must be an ArrayLiteral" unless options.is_a? ArrayLiteral %}
{% if options.is_a? Call %}
{% elsif options.is_a? ArrayLiteral %}
{% else %}
{% raise "ERROR : CliGen::Command.argument(#{name}) : Provided options must be an ArrayLiteral or a runtime method call to retrieve data" %}
{% end %}
{% end %}
{% if format %}
{% format = format.resolve if format.is_a? Path %}