From ec1eba2f8daff87ca84a17e738fc3b9480c42517 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 10:12:35 +0100 Subject: Fixed verbosity. --- lib/snmp/src/compile/snmpc.src | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'lib/snmp') 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} -> -- cgit v1.2.3