fix: add -b flag to file mime type detection
This commit is contained in:
committed by
Andrew Phillips (aider)
parent
ca8629a3ac
commit
c7007cd416
@@ -61,7 +61,7 @@ lazy_static! {
|
|||||||
if program.supported { Some(program) } else { None }
|
if program.supported { Some(program) } else { None }
|
||||||
}
|
}
|
||||||
MetaPluginType::FileMime => {
|
MetaPluginType::FileMime => {
|
||||||
let program = MetaPluginProgram::new("file", vec!["--mime-type", "-"], "file_mime".to_string(), true);
|
let program = MetaPluginProgram::new("file", vec!["-b", "--mime-type", "-"], "file_mime".to_string(), true);
|
||||||
if program.supported { Some(program) } else { None }
|
if program.supported { Some(program) } else { None }
|
||||||
}
|
}
|
||||||
MetaPluginType::FileEncoding => {
|
MetaPluginType::FileEncoding => {
|
||||||
@@ -102,7 +102,7 @@ lazy_static! {
|
|||||||
pub fn get_meta_plugin(meta_plugin_type: MetaPluginType) -> Box<dyn MetaPlugin> {
|
pub fn get_meta_plugin(meta_plugin_type: MetaPluginType) -> Box<dyn MetaPlugin> {
|
||||||
match meta_plugin_type {
|
match meta_plugin_type {
|
||||||
MetaPluginType::FileMagic => Box::new(MetaPluginProgram::new("file", vec!["-bE", "-"], "file_magic".to_string(), true)),
|
MetaPluginType::FileMagic => Box::new(MetaPluginProgram::new("file", vec!["-bE", "-"], "file_magic".to_string(), true)),
|
||||||
MetaPluginType::FileMime => Box::new(MetaPluginProgram::new("file", vec!["--mime-type", "-"], "file_mime".to_string(), true)),
|
MetaPluginType::FileMime => Box::new(MetaPluginProgram::new("file", vec!["-b", "--mime-type", "-"], "file_mime".to_string(), true)),
|
||||||
MetaPluginType::FileEncoding => Box::new(MetaPluginProgram::new("file", vec!["-b", "--mime-encoding", "-"], "file_encoding".to_string(), true)),
|
MetaPluginType::FileEncoding => Box::new(MetaPluginProgram::new("file", vec!["-b", "--mime-encoding", "-"], "file_encoding".to_string(), true)),
|
||||||
MetaPluginType::LineCount => Box::new(MetaPluginProgram::new("wc", vec!["-l"], "line_count".to_string(), true)),
|
MetaPluginType::LineCount => Box::new(MetaPluginProgram::new("wc", vec!["-l"], "line_count".to_string(), true)),
|
||||||
MetaPluginType::WordCount => Box::new(MetaPluginProgram::new("wc", vec!["-w"], "word_count".to_string(), true)),
|
MetaPluginType::WordCount => Box::new(MetaPluginProgram::new("wc", vec!["-w"], "word_count".to_string(), true)),
|
||||||
|
|||||||
Reference in New Issue
Block a user