summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-04-01 03:05:17 +0200
committerFlorian Pritz <bluewind@xssn.at>2010-04-01 03:05:17 +0200
commit33184d4a01f4b95fd7f319d11cd4b71a765885b9 (patch)
tree537a7519cc5d87a61c6ea8fab2ac6c67e55e4bd1 /scripts
parent8c514266239c745101a71cdf9a5f1982fc3812ce (diff)
mimetype: add --orig-name and use it
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mimetype9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/mimetype b/scripts/mimetype
index ec191adc8..43c69ebc6 100755
--- a/scripts/mimetype
+++ b/scripts/mimetype
@@ -22,6 +22,7 @@ my %opts = (
'stdin' => [''],
'brief' => ['b'],
'namefile' => ['f', 1],
+ 'orig-name' => ['', 1],
'noalign' => ['N'],
'describe' => ['d'],
'file-compat' => [''],
@@ -192,6 +193,14 @@ foreach my $file (@ARGV) {
print $format->($file, $m), "\n" if $m;
}
}
+ elsif ($args{'orig-name'}) {
+ my $type = globs($args{'orig-name'});
+ if ($type ne "") {
+ print $format->($file, $type), "\n";
+ } else {
+ print $format->($file, mimetype($f)), "\n";
+ }
+ }
else { print $format->($file, mimetype($f)), "\n" }
}