mirror of
https://github.com/sharkdp/bat
synced 2026-08-04 19:01:44 +00:00
Support for ignored-suffix CLI arguments (#1892)
This commit is contained in:
@@ -107,6 +107,12 @@ impl App {
|
||||
|
||||
let mut syntax_mapping = SyntaxMapping::builtin();
|
||||
|
||||
if let Some(values) = self.matches.values_of("ignored-suffix") {
|
||||
for suffix in values {
|
||||
syntax_mapping.insert_ignored_suffix(suffix);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(values) = self.matches.values_of("map-syntax") {
|
||||
for from_to in values {
|
||||
let parts: Vec<_> = from_to.split(':').collect();
|
||||
|
||||
@@ -509,6 +509,18 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
||||
.hidden_short_help(true)
|
||||
.help("Show diagnostic information for bug reports.")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("ignored-suffix")
|
||||
.number_of_values(1)
|
||||
.multiple(true)
|
||||
.takes_value(true)
|
||||
.long("ignored-suffix")
|
||||
.hidden_short_help(true)
|
||||
.help(
|
||||
"Ignore extension. For example:\n \
|
||||
'bat --ignored-suffix \".dev\" my_file.json.dev' will use JSON syntax, and ignore '.dev'"
|
||||
)
|
||||
)
|
||||
.help_message("Print this help message.")
|
||||
.version_message("Show version information.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user