bin/rconf in rconf-0.5.9 vs bin/rconf in rconf-0.6.1
- old
+ new
@@ -35,11 +35,11 @@
opt :configurators, 'Show available configurators'
opt :config, 'Set path to configuration file', :type => :string
opt :output, 'Output file (output to STDOUT by default)', :type => :string
opt :verbose, 'Print debug output'
end
- if opts[:config].nil?
+ if opts[:config].nil? && !opts[:configurators]
opts[:config] = Dir['./*.rc']
if opts[:config].empty?
Trollop::die :config, "not used and could not find a '.rc' file in the working directory"
else
opts[:config] = opts[:config].first
@@ -72,10 +72,11 @@
puts 'Settings:'
max_size = configurator.all_settings.keys.map(&:to_s).map(&:size).max
configurator.all_settings.each do |name, desc|
num_spaces = max_size - name.to_s.size + 1
print " - #{name.to_s.blue}:#{' ' * num_spaces}#{desc}"
- if configurator.required_settings.include?(name)
+ required_settings = configurator.required_settings || []
+ if required_settings.include?(name)
puts ' [required]'.green
else
puts
end
end