Added guard for empty @flags array in template

This commit is contained in:
Tristan Ancelet
2026-08-12 13:01:41 -05:00
parent f889aae5e1
commit 28c45fae9e
+2
View File
@@ -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