File: help.erb

package info (click to toggle)
ruby-commander 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 364 kB
  • sloc: ruby: 1,969; makefile: 9
file content (36 lines) | stat: -rw-r--r-- 1,125 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  <%= HighLine.default_instance.color "NAME", :bold %>:

    <%= program :name %>

  <%= HighLine.default_instance.color "DESCRIPTION", :bold %>:

    <%= Commander::HelpFormatter.indent 4, program(:description) %>

  <%= HighLine.default_instance.color "COMMANDS", :bold %>:
<% for name, command in @commands.sort -%>
	<% unless alias? name %>
    <%= "%-#{max_command_length}s %s" % [command.name, command.summary || command.description] -%>
	<% end -%>
<% end %>
<% unless @aliases.empty? %>
  <%= HighLine.default_instance.color "ALIASES", :bold %>:
  <% for alias_name, args in @aliases.sort %>
    <%= "%-#{max_aliases_length}s %s %s" % [alias_name, command(alias_name).name, args.join(' ')] -%>
  <% end %>
<% end %>
<% unless @options.empty? -%>
  <%= HighLine.default_instance.color "GLOBAL OPTIONS", :bold %>:
	<% for option in @options -%>

    <%= option[:switches].join ', ' %>
        <%= option[:description] %>
	<% end -%>
<% end -%>
<% if program :help -%>
  <% for title, body in program(:help) %>
  <%= HighLine.default_instance.color title.to_s.upcase, :bold %>:

    <%= body %>
  <% end -%>
<% end -%>