X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fperl%2FConfigure.pm;h=383639f9ea3fd1ffb61e47208b4b1184852a193a;hb=396571ed89ec4260ba3fd1b7ce2b38b07bd90ab7;hp=ee1c83df114397bd71a3a54ac464296d6e4640dd;hpb=238f36749a3e861b855fd1149ccfe814116e6466;p=libucw.git diff --git a/lib/perl/Configure.pm b/lib/perl/Configure.pm index ee1c83df..383639f9 100644 --- a/lib/perl/Configure.pm +++ b/lib/perl/Configure.pm @@ -16,7 +16,7 @@ BEGIN { our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); $VERSION = 1.0; @ISA = qw(Exporter); - @EXPORT = qw(&Init &Log &Notice &Fail &IsSet &Set &UnSet &Append &Override &Get &Test &Include &Finish &FindFile &TryFindFile); + @EXPORT = qw(&Init &Log &Notice &Warn &Fail &IsSet &Set &UnSet &Append &Override &Get &Test &Include &Finish &FindFile &TryFindFile); @EXPORT_OK = qw(); %EXPORT_TAGS = (); } @@ -32,8 +32,12 @@ sub Notice($) { print @_ if $vars{"VERBOSE"}; } +sub Warn($) { + print "WARNING: ", @_; +} + sub Fail($) { - Log((shift @_) . "\n"); + Log("ERROR: " . (shift @_) . "\n"); exit 1; } @@ -115,12 +119,12 @@ sub Init($$) { if ($x =~ /^(\w+)=(.*)/) { Override($1 => $2); } elsif ($x =~ /^-(\w+)$/) { - Override($1 => 1); + Override($1 => 0); delete $vars{$1}; } elsif ($x =~ /^(\w+)$/) { Override($1 => 1); } else { - print STDERR "Invalid option $_\n"; + print STDERR "Invalid option $x\n"; exit 1; } }