mothership 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,22 @@ module Mothership::Help
17
17
  command_options(global)
18
18
  end
19
19
 
20
+ def unique_commands(commands)
21
+ uniq_commands = []
22
+ cmd_index = {}
23
+
24
+ commands.each do |cmd|
25
+ if idx = cmd_index[cmd.name]
26
+ uniq_commands[idx] = cmd
27
+ else
28
+ cmd_index[cmd.name] = uniq_commands.size
29
+ uniq_commands << cmd
30
+ end
31
+ end
32
+
33
+ uniq_commands
34
+ end
35
+
20
36
  def print_help_group(group, all = false, indent = 0)
21
37
  return if nothing_printable?(group, all)
22
38
 
@@ -35,6 +51,8 @@ module Mothership::Help
35
51
  print i
36
52
  puts group[:description]
37
53
 
54
+ commands = unique_commands(commands)
55
+
38
56
  width = 0
39
57
  commands.each do |cmd|
40
58
  len = cmd.usage.size
@@ -1,3 +1,3 @@
1
1
  class Mothership
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mothership
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Suraci
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-09-05 00:00:00 Z
18
+ date: 2012-09-07 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake