[doc] create-mime.conf.pl -v for warnings

Do not issue warnings about duplicated entries unless called with -v

/etc/mime.types is not typically edited by the end user,
so the warning trace is noise to most end users.
Glenn Strauss 2 years ago
parent a89e94e0bf
commit be8909833b

@ -5,6 +5,10 @@
use strict;
# future: might use Getopt::Std, but this is simple enough for now
my $verbose = 0;
foreach (@ARGV) { $verbose = 1 if ($_ eq "-v"); }
# text/* subtypes to serve as "text/...; charset=utf-8"
# text/html IS NOT INCLUDED: html has its own method for defining charset
# (<meta>), but the standards specify that content-type in HTTP wins over
@ -130,7 +134,7 @@ sub add {
print STDERR "Duplicate mimetype: '${extension}' => '${mimetype}' (already have '${have}'), merging to 'application/octet-stream'\n";
print STDERR "Duplicate mimetype: '${extension}' => '${mimetype}' (already have '${have}'), merging to 'application/octet-stream'\n" if $verbose;
set ($extension, 'application/octet-stream');
} else {
set @_;