perl-File-MimeInfo/perl-File-MimeInfo-0.13-no-ask-option.diff
pertusus 6c88b1dc9c auto-import perl-File-MimeInfo-0.13-2 on branch devel from
perl-File-MimeInfo-0.13-2.src.rpm
2006-10-14 21:42:51 +00:00

36 lines
821 B
Diff

--- /usr/bin/mimeopen 2006-10-11 16:57:53.000000000 +0200
+++ mimeopen 2006-10-11 21:27:45.000000000 +0200
@@ -24,6 +24,7 @@
'magic-only' => ['M'],
'ask' => ['a'],
'ask-default' => ['d'],
+ 'no-ask' => ['n'],
);
while ((@ARGV) && ($ARGV[0] =~ /^-/)) {
@@ -153,7 +154,10 @@
exit 6;
}
-if ($args{ask}) {
+if ($args{'no-ask'}) {
+ $default = defined($default) ? $default : $other[0];
+}
+elsif ($args{ask}) {
$default = choose($mimetype, 0, grep defined($_), $default, @other);
}
elsif ($args{'ask-default'}) {
@@ -305,6 +309,12 @@
Print the version of the program and exit.
+=item B<-n>, B<--no-ask>
+
+Don't ask the user which program to use. Choose the default program or the
+first program known to handle the file mimetype. This does not set the
+default application.
+
=back
=head1 BUGS