Allow using wildcard mime types when copying from clipboard
This commit is contained in:
parent
5c9c9a67bc
commit
b644a42a48
2 changed files with 9 additions and 1 deletions
|
|
@ -22,7 +22,9 @@
|
|||
The mimetype of the specified file. Useful when the auto-detected mimetype is
|
||||
likely to be incorrect or the filename has no extension and therefore no mimetype
|
||||
can be detected. If more than one file is specified, this option should be specified multiple
|
||||
times, once for each specified file.
|
||||
times, once for each specified file. When copying data from the clipboard, you can use wildcards
|
||||
to match MIME types. For example: :code:`--mime 'text/*'` will match any textual MIME type
|
||||
available on the clipboard, usually the first matching MIME type is copied.
|
||||
|
||||
|
||||
--alias -a
|
||||
|
|
|
|||
|
|
@ -156,6 +156,12 @@ func (self *Output) assign_mime_type(available_mimes []string, aliases map[strin
|
|||
}
|
||||
}
|
||||
}
|
||||
for _, mt := range available_mimes {
|
||||
if matched, _ := filepath.Match(self.mime_type, mt); matched {
|
||||
self.remote_mime_type = mt
|
||||
return
|
||||
}
|
||||
}
|
||||
if images.EncodableImageTypes[self.mime_type] {
|
||||
for _, mt := range available_mimes {
|
||||
if images.DecodableImageTypes[mt] {
|
||||
|
|
|
|||
Loading…
Reference in a new issue