From 46fb5de7cddbf41a032d0aeabae77b2798cd466b Mon Sep 17 00:00:00 2001 From: Yousef Ourabi Date: Wed, 9 Jan 2013 10:04:19 -0800 Subject: [PATCH] aspell: add English dictionary by default Fixes #16031. Closes #16972. Signed-off-by: Adam Vandenberg --- Library/Formula/aspell.rb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Library/Formula/aspell.rb b/Library/Formula/aspell.rb index 1e09fabf28a6..56258d72d5ab 100644 --- a/Library/Formula/aspell.rb +++ b/Library/Formula/aspell.rb @@ -20,24 +20,23 @@ class Aspell < Formula cause "Segmentation fault during linking." end - def options - [ - ['--lang=XX,...', "Install dictionary for language XX where XX is the country code, e.g.: --lang=en,es\n\tAvailable country codes: #{available_languages.join(', ')}"], - ['--all', "Install all available dictionaries"] - ] - end + option "with-lang", "Install dictionary for language XX where XX is the country code, e.g.: --with-lang=en,es\n" + option "all", "Install all available dictionaries" def install system "./configure", "--prefix=#{prefix}" system "make install" languages = [] - if ARGV.include?('--all') + + ARGV.select { |v| v =~ /with-lang/ }.uniq.each do |opt| + languages << opt.split('=')[1].split(',') + end + + if build.include? 'all' languages << available_languages.to_a else - ARGV.options_only.select { |v| v =~ /--lang=/ }.uniq.each do |opt| - languages << opt.split('=')[1].split(',') - end + languages << "en" if languages.empty? end languages.flatten.each do |lang| begin