Commit ba54d19c authored by Fabio Pelosin's avatar Fabio Pelosin

"[Pod::Command] simplification of --no-color option"

parent 24230dc8
......@@ -84,24 +84,12 @@ module Pod
argv = ARGV.new(argv)
raise Informative, VERSION if argv.option('--version')
if argv.option('--no-color')
methods_to_ovverride = Colored::EXTRAS.keys
Colored::COLORS.keys.each do |color|
methods_to_ovverride << color
methods_to_ovverride << "on_#{color}"
Colored::COLORS.keys.each do |highlight|
methods_to_ovverride << "#{color}_on_#{highlight}"
end
end
methods_to_ovverride.each do | method_name |
String.send(:define_method, method_name.to_sym) { return self }
end
end
show_help = argv.option('--help')
Config.instance.silent = argv.option('--silent')
Config.instance.verbose = argv.option('--verbose')
String.send(:define_method, :colorize) { return self } if argv.option('--no-color')
command_class = case argv.shift_argument
when 'install' then Install
when 'repo' then Repo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment