on master help sign in
Update documentation
commit978def2d40914a83e245fdbb82b8b1ba9fcf81b5 authorsharkdp <davidpeter@web.de> dateSun 22 Mar 2020, 10:37 (7 years ago) parent57aed07
6 files changed+25−25
README.md+4−4 assets/manual/bat.1.in+5−5 doc/README-ja.md+4−4 doc/README-ko.md+4−4 src/bin/bat/app.rs+1−1 src/bin/bat/clap_app.rs+7−7
README.md+4−4
@@ -500,11 +500,11 @@ Example configuration file:
500500# Use italic text on the terminal (not supported on all terminals)
501501--italic-text=always
502502
503−# Use C++ syntax (instead of C) for .h header files
504−--map-syntax h:cpp
503+# Use C++ syntax for .ino files
504+--map-syntax "*.ino:C++"
505505
506−# Use "gitignore" highlighting for ".ignore" files
507−--map-syntax .ignore:.gitignore
506+# Use ".gitignore"-style highlighting for ".ignore" files
507+--map-syntax ".ignore:Git Ignore"
508508```
509509
510510## Using `bat` on Windows
assets/manual/bat.1.in+5−5
@@ -100,12 +100,12 @@ Determine which pager is used. This option will overwrite the PAGER and BAT_PAGE
100100environment variables. The default pager is 'less'. To disable the pager completely, use
101101the '\-\-paging' option. Example: '\-\-pager "less \fB\-RF\fR"'.
102102.HP
103−\fB\-m\fR, \fB\-\-map\-syntax\fR <from:to>...
103+\fB\-m\fR, \fB\-\-map\-syntax\fR <glob-pattern:syntax-name>...
104104.IP
105−Map a file extension or file name to an existing syntax (specified by a file extension
106−or file name). For example, to highlight *.build files with the Python syntax, use '\-m
107−build:py'. To highlight files named '.myignore' with the Git Ignore syntax, use '\-m
108−\&.myignore:gitignore'.
105+Map a glob pattern to an existing syntax name. The glob pattern is matched on the full
106+path and the filename. For example, to highlight *.build files with the Python syntax,
107+use -m '*.build:Python'. To highlight files named '.myignore' with the Git Ignore
108+syntax, use -m '.myignore:Git Ignore'.
109109.HP
110110\fB\-\-theme\fR <theme>
111111.IP
doc/README-ja.md+4−4
@@ -500,11 +500,11 @@ export BAT_CONFIG_PATH="/path/to/bat.conf"
500500# Use italic text on the terminal (not supported on all terminals)
501501--italic-text=always
502502
503−# Use C++ syntax (instead of C) for .h header files
504−--map-syntax h:cpp
503+# Use C++ syntax for .ino files
504+--map-syntax "*.ino:C++"
505505
506−# Use "gitignore" highlighting for ".ignore" files
507−--map-syntax .ignore:.gitignore
506+# Use ".gitignore"-style highlighting for ".ignore" files
507+--map-syntax ".ignore:Git Ignore"
508508```
509509
510510## Windows での `bat` の利用
doc/README-ko.md+4−4
@@ -452,11 +452,11 @@ export BAT_CONFIG_PATH="/path/to/bat.conf"
452452# Use italic text on the terminal (not supported on all terminals)
453453--italic-text=always
454454
455−# Use C++ syntax (instead of C) for .h header files
456−--map-syntax h:cpp
455+# Use C++ syntax for .ino files
456+--map-syntax "*.ino:C++"
457457
458−# Use "gitignore" highlighting for ".ignore" files
459−--map-syntax .ignore:.gitignore
458+# Use ".gitignore"-style highlighting for ".ignore" files
459+--map-syntax ".ignore:Git Ignore"
460460```
461461
462462## Windows에서 사용하기
src/bin/bat/app.rs+1−1
@@ -111,7 +111,7 @@ impl App {
111111 let parts: Vec<_> = from_to.split(':').collect();
112112
113113 if parts.len() != 2 {
114− return Err("Invalid syntax mapping. The format of the -m/--map-syntax option is 'from:to'.".into());
114+ return Err("Invalid syntax mapping. The format of the -m/--map-syntax option is '<glob-pattern>:<syntax-name>'. For example: '*.cpp:C++'.".into());
115115 }
116116
117117 syntax_mapping.insert(parts[0], MappingTarget::MapTo(parts[1]))?;
src/bin/bat/clap_app.rs+7−7
@@ -248,13 +248,13 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
248248 .multiple(true)
249249 .takes_value(true)
250250 .number_of_values(1)
251− .value_name("from:to")
252− .help("Map a file extension or name to an existing syntax.")
251+ .value_name("glob:syntax")
252+ .help("Use the specified syntax for files matching the glob pattern ('*.cpp:C++').")
253253 .long_help(
254− "Map a file extension or file name to an existing syntax (specified by a file \
255− extension or file name). For example, to highlight *.build files with the \
256− Python syntax, use '-m build:py'. To highlight files named '.myignore' with \
257− the Git Ignore syntax, use '-m .myignore:gitignore'.",
254+ "Map a glob pattern to an existing syntax name. The glob pattern is matched \
255+ on the full path and the filename. For example, to highlight *.build files \
256+ with the Python syntax, use -m '*.build:Python'. To highlight files named \
257+ '.myignore' with the Git Ignore syntax, use -m '.myignore:Git Ignore'.",
258258 )
259259 .takes_value(true),
260260 )
@@ -281,7 +281,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
281281 .arg(
282282 Arg::with_name("style")
283283 .long("style")
284− .value_name("style-components")
284+ .value_name("components")
285285 // Need to turn this off for overrides_with to work as we want. See the bottom most
286286 // example at https://docs.rs/clap/2.32.0/clap/struct.Arg.html#method.overrides_with
287287 .use_delimiter(false)