Skip to content

Commit a6df70a

Browse files
committed
Add application:get_env/2
Signed-off-by: Paul Guyot <[email protected]>
1 parent f6069ec commit a6df70a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

libs/estdlib/src/application.erl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,23 @@
1919
%
2020

2121
-module(application).
22-
-export([get_env/3]).
22+
-export([get_env/2, get_env/3]).
2323
-export_type([start_type/0]).
2424

2525
-type start_type() :: normal | {takeover, Node :: node()} | {failover, Node :: node()}.
2626

27+
%%-----------------------------------------------------------------------------
28+
%% @param Application application to get the parameter value of
29+
%% @param Parameter parameter to get the value of
30+
%% @returns undefined
31+
%% @doc Retrieve the value of the configuration parameter `Parameter' for
32+
%% application `Application' or `undefined' if not found.
33+
%% @end
34+
%%-----------------------------------------------------------------------------
35+
-spec get_env(Application :: atom(), Parameter :: atom()) -> any().
36+
get_env(Application, Parameter) ->
37+
get_env(Application, Parameter, undefined).
38+
2739
%%-----------------------------------------------------------------------------
2840
%% @param Application application to get the parameter value of
2941
%% @param Parameter parameter to get the value of

0 commit comments

Comments
 (0)