Added guard for empty @flags array in template
This commit is contained in:
@@ -3,6 +3,7 @@ Command: <%= @name %>
|
|||||||
Description: <%= @description %>
|
Description: <%= @description %>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
|
|
||||||
|
<%- unless @flags.empty? -%>
|
||||||
<%- len = @flags.map{|f| f.short.nil? ? f.long.size : "#{f.short},#{f.long}".size}.max + 5 -%>
|
<%- len = @flags.map{|f| f.short.nil? ? f.long.size : "#{f.short},#{f.long}".size}.max + 5 -%>
|
||||||
|
|
||||||
Flags:
|
Flags:
|
||||||
@@ -14,6 +15,7 @@ Flags:
|
|||||||
<%= "%-#{len}s %s" % [flag.long.strip, flag.description.strip] %>
|
<%= "%-#{len}s %s" % [flag.long.strip, flag.description.strip] %>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
|
|
||||||
|
<%- end -%>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
<%- unless @commands.empty? -%>
|
<%- unless @commands.empty? -%>
|
||||||
Other Commands
|
Other Commands
|
||||||
|
|||||||
Reference in New Issue
Block a user