Merge pull request #132 from alexthornton1/mib_to_hrl_verbosity

mib_to_hrl compilation verbosity via 'mib_opts'
This commit is contained in:
Dave Smith 2013-09-20 07:10:26 -07:00
commit d19a46676c

View file

@ -34,6 +34,7 @@
info/2]). info/2]).
-include("rebar.hrl"). -include("rebar.hrl").
-include_lib("stdlib/include/erl_compile.hrl").
%% =================================================================== %% ===================================================================
%% Public API %% Public API
@ -401,7 +402,14 @@ compile_mib(Source, Target, Config) ->
case snmpc:compile(Source, Opts) of case snmpc:compile(Source, Opts) of
{ok, _} -> {ok, _} ->
Mib = filename:rootname(Target), Mib = filename:rootname(Target),
ok = snmpc:mib_to_hrl(Mib), MibToHrlOpts =
case proplists:get_value(verbosity, Opts, undefined) of
undefined ->
#options{specific = []};
Verbosity ->
#options{specific = [{verbosity, Verbosity}]}
end,
ok = snmpc:mib_to_hrl(Mib, Mib, MibToHrlOpts),
Hrl_filename = Mib ++ ".hrl", Hrl_filename = Mib ++ ".hrl",
rebar_file_utils:mv(Hrl_filename, "include"), rebar_file_utils:mv(Hrl_filename, "include"),
ok; ok;