Added guard for empty @flags array in template
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user