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
|
# File 'lib/shapeup_cli/surface.rb', line 10
def self.lines
lines = []
TOP_LEVEL_COMMANDS.each { |name| lines << "CMD shapeup #{name}" }
ShapeupCli.top_level_metadata[:shortcuts].each_key do |shortcut|
lines << "CMD shapeup #{shortcut.split.first}"
end
ShapeupCli.top_level_metadata[:inherited_flags].each do |flag|
lines << "FLAG shapeup --#{flag[:name]} #{flag[:type]}"
end
ShapeupCli::COMMAND_MAP.each do |name, klass|
lines << "CMD shapeup #{name}"
metadata = klass.metadata
(metadata[:subcommands] || []).each do |sub|
lines << "SUB shapeup #{name} #{sub[:name]}"
end
(metadata[:flags] || []).each do |flag|
lines << "FLAG shapeup #{name} --#{flag[:name]} #{flag[:type]}"
end
end
lines.uniq.sort
end
|