Skip to content

Instantly share code, notes, and snippets.

@alco
Forked from josevalim/exercise.exs
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alco/534bc4cdd1d84657f139 to your computer and use it in GitHub Desktop.
Save alco/534bc4cdd1d84657f139 to your computer and use it in GitHub Desktop.
@proto_version "1.0"
def process_options(opts) do
ret = Enum.reduce(opts, [], fn
{:in, _}, ret -> ["-in"|ret]
{:err, :out}, ret -> ["-err", "out"|ret]
{:err, :err}, ret -> ["-err", "err"|ret]
{:dir, dir}, ret -> ["-dir", dir|ret]
_ -> ret
end)
ret = case :application.get_env(:porcelain, :goon_driver_log) do
:undefined -> ret
{:ok, val} -> ["-log", val|ret]
end
["-proto", @proto_version|ret]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment