From 28c45fae9e4523e0c9011e3302f0e5f5c76a16a8 Mon Sep 17 00:00:00 2001 From: Tristan Ancelet Date: Wed, 12 Aug 2026 13:01:41 -0500 Subject: [PATCH] Added guard for empty @flags array in template --- src/cligen/template/cmd_help.ecr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cligen/template/cmd_help.ecr b/src/cligen/template/cmd_help.ecr index aa84e15..52ef103 100644 --- a/src/cligen/template/cmd_help.ecr +++ b/src/cligen/template/cmd_help.ecr @@ -3,6 +3,7 @@ Command: <%= @name %> Description: <%= @description %> <%- end -%> +<%- unless @flags.empty? -%> <%- len = @flags.map{|f| f.short.nil? ? f.long.size : "#{f.short},#{f.long}".size}.max + 5 -%> Flags: @@ -14,6 +15,7 @@ Flags: <%= "%-#{len}s %s" % [flag.long.strip, flag.description.strip] %> <%- end -%> +<%- end -%> <%- end -%> <%- unless @commands.empty? -%> Other Commands