thunder 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/thunder/options/optparse.rb +3 -3
- data/lib/thunder/options/trollop.rb +1 -2
- data/lib/thunder/version.rb +1 -1
- metadata +1 -1
@@ -11,12 +11,12 @@ module Thunder::OptParseAdapter
|
|
11
11
|
command_spec[:options].each do |name, option_spec|
|
12
12
|
opt = []
|
13
13
|
opt << "-#{option_spec[:short]}"
|
14
|
-
opt << if option_spec[:type] == Boolean
|
14
|
+
opt << if option_spec[:type] == Thunder::Boolean
|
15
15
|
"--[no-]#{name}"
|
16
16
|
else
|
17
17
|
"--#{name} [#{name.to_s.upcase}]"
|
18
18
|
end
|
19
|
-
opt << option_spec[:type] unless option_spec[:type] == Boolean
|
19
|
+
opt << option_spec[:type] unless option_spec[:type] == Thunder::Boolean
|
20
20
|
opt << option_spec[:desc]
|
21
21
|
parser.on(*opt) do |value|
|
22
22
|
options[name] = value
|
@@ -28,7 +28,7 @@ module Thunder::OptParseAdapter
|
|
28
28
|
# set default values
|
29
29
|
command_spec[:options].each do |name, option_spec|
|
30
30
|
next if options.has_key? name
|
31
|
-
next unless option_spec
|
31
|
+
next unless option_spec.has_key? :default
|
32
32
|
options[name] = option_spec[:default]
|
33
33
|
end
|
34
34
|
|
@@ -13,8 +13,7 @@ class Thunder::TrollopAdapter
|
|
13
13
|
type = option_spec[:type]
|
14
14
|
type = :flag if type == Thunder::Boolean
|
15
15
|
opt_options[:type] = type
|
16
|
-
|
17
|
-
opt_options[:default] = default_value if default_value
|
16
|
+
opt_options[:default] = option_spec[:default] if options_spec.has_key? :default
|
18
17
|
opt_options[:short] = "-" + option_spec[:short]
|
19
18
|
|
20
19
|
opt name, description, opt_options
|
data/lib/thunder/version.rb
CHANGED