aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/snmp')
-rw-r--r--lib/snmp/src/compile/snmpc.src32
1 files changed, 28 insertions, 4 deletions
diff --git a/lib/snmp/src/compile/snmpc.src b/lib/snmp/src/compile/snmpc.src
index f4336a3264..4581339015 100644
--- a/lib/snmp/src/compile/snmpc.src
+++ b/lib/snmp/src/compile/snmpc.src
@@ -1,6 +1,27 @@
#!/usr/bin/env escript
%% -*- erlang -*-
%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%% SNMP MIB compiler frontend
+%%
+
+-mode(compile).
-include_lib("kernel/include/file.hrl").
@@ -25,10 +46,13 @@
relaxed_row_name_assigne_check = false,
%% The default verbosity (silence) will be filled in
%% during argument processing.
- verbosity,
- warnings = false
+ verbosity,
+ warnings = false
}).
+
+%% ------------------------------------------------------------------------
+%% Valid arguments:
%% --o Dir [defaults to "./"]
%% --i Dir [defaults to "./"]
%% --il Dir
@@ -75,7 +99,7 @@ compile(State) ->
end.
mk_file(#state{mib_file = MIB}) ->
- DirName = filename:dirname(MIB),
+ DirName = filename:dirname(MIB),
BaseName = filename:basename(MIB, ".mib"),
filename:join(DirName, BaseName).
@@ -150,7 +174,7 @@ process_args([], #state{verbosity = Verbosity0, mib_file = MIB} = State) ->
process_args([MIB], State) ->
case (catch file:read_file_info(MIB)) of
{ok, #file_info{type = regular}} ->
- {ok, State#state{mib_file = MIB}};
+ process_args([], State#state{mib_file = MIB});
{ok, #file_info{type = BadType}} ->
e(lists:flatten(io_lib:format("~s not a file: ~w", [MIB, BadType])));
{error, enoent} ->