Skip to content
Snippets Groups Projects
Commit 546a91f7 authored by Markus Reiter's avatar Markus Reiter
Browse files

Add `—language` option.

parent b703c81c
No related branches found
No related tags found
No related merge requests found
......@@ -179,6 +179,10 @@ module Hbc
def self.parser
# If you modify these arguments, please update USAGE.md
@parser ||= OptionParser.new do |opts|
opts.on("--language STRING") do
# handled in OS::Mac
end
OPTIONS.each do |option, method|
opts.on("#{option}" "PATH", Pathname) do |path|
Hbc.public_send(method, path)
......
......@@ -42,11 +42,19 @@ module OS
end
def languages
@languages ||= if ENV["HOMEBREW_LANGUAGES"]
ENV["HOMEBREW_LANGUAGES"].split(",")
else
Utils.popen_read("defaults", "read", ".GlobalPreferences", "AppleLanguages").scan(/[^ \n"(),]+/)
return @languages unless @languages.nil?
@languages = Utils.popen_read("defaults", "read", ".GlobalPreferences", "AppleLanguages").scan(/[^ \n"(),]+/)
if ENV["HOMEBREW_LANGUAGES"]
@languages = ENV["HOMEBREW_LANGUAGES"].split(",") + @languages
end
if ARGV.value("language")
@languages = ARGV.value("language").split(",") + @languages
end
@languages = @languages.uniq
end
def language
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment