summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2009-12-01 10:37:46 -0700
committerDave Smith <dizzyd@dizzyd.com>2009-12-01 10:37:46 -0700
commitcf6738928d74dec321349f5fad59959d5131fdd9 (patch)
tree819d7cdcde51739c492dc15544673677887bb464
parentb3909cc9dc308b26cfd98b048944a99a57eee560 (diff)
Adding generic get/3; still need some cleanup
-rw-r--r--src/rebar_config.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rebar_config.erl b/src/rebar_config.erl
index 3e2087c..5cf15ef 100644
--- a/src/rebar_config.erl
+++ b/src/rebar_config.erl
@@ -27,6 +27,7 @@
-export([new/1,
get_modules/2,
get_list/3,
+ get/3,
set_global/2, get_global/2]).
-include("rebar.hrl").
@@ -74,6 +75,14 @@ get_list(Config, Key, Default) ->
List
end.
+get(Config, Key, Default) ->
+ case orddict:find(Key, Config#config.opts) of
+ error ->
+ Default;
+ {ok, Value} ->
+ Value
+ end.
+
set_global(Key, Value) ->
application:set_env(rebar_global, Key, Value).