mothership 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -150,16 +150,22 @@ module Mothership::Help
150
150
 
151
151
  flag = name.to_s.gsub("_", "-")
152
152
 
153
- full = fs.delete "--#{flag}"
153
+ # move full form to the front
154
+ fs.unshift fs.delete("--#{flag}")
154
155
 
155
- short = fs.find { |x| x =~ /^-.$/ }
156
- fs.delete short if short
156
+ if short = fs.find { |x| x =~ /^-.$/ }
157
+ fs.delete short
158
+ end
157
159
 
158
160
  if info[:type] == :boolean && info[:default] == true
159
- full = "--[no-]#{flag}"
161
+ fs.unshift "--[no-]#{flag}"
162
+ end
163
+
164
+ if info.key?(:default) && info.key?(:interact)
165
+ fs.unshift "--ask-#{flag}"
160
166
  end
161
167
 
162
- usage = "#{short ? short + "," : " "} #{([full] + fs).join ", "}"
168
+ usage = "#{short ? short + "," : " "} #{fs.join ", "}"
163
169
 
164
170
  unless info[:type] == :boolean
165
171
  usage << " #{(info[:value] || name).to_s.upcase}"
@@ -1,3 +1,3 @@
1
1
  class Mothership
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
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-10-09 00:00:00 Z
18
+ date: 2012-10-11 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake