From 8d17de74348e5dc3f1fd9299f1d59ac6f40a199d Mon Sep 17 00:00:00 2001 From: Tristan Ancelet Date: Mon, 10 Aug 2026 13:12:12 -0500 Subject: [PATCH] Fix annotation key mismatch: validate -> validation in generate.cr anno[:validate] was always nil; validation procs were never wired into Flag(T).new. Correct key is :validation to match the field name set by the argument macro in command/argument.cr. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01ATnpoEGXj4RyuMoBLGWcjs --- src/cligen/app/generate.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cligen/app/generate.cr b/src/cligen/app/generate.cr index 315e1f2..53e30a3 100644 --- a/src/cligen/app/generate.cr +++ b/src/cligen/app/generate.cr @@ -27,7 +27,7 @@ module CliGen env_var: {% if anno[:env_var] %} {{anno[:env_var]}} {% else %} {{"#{cmd.name.split("::").last.upcase.id}_#{var.name.upcase}"}} {% end %}, description: {{ anno[:description] }}, default: {% unless var.default_value.nil? %} {{var.default_value}} {% else %} nil {% end %}, - validate: {% if anno[:validate] %} {{anno[:validate]}} {% else %} nil {% end %}, + validate: {% if anno[:validation] %} {{anno[:validation]}} {% else %} nil {% end %}, on_match: {% if anno[:on_match] %} {{anno[:on_match]}} {% else %} nil {% end %} ) {% debug if env("DEBUG") %}