Update documentation

This commit is contained in:
sharkdp 2020-03-22 10:37:18 +01:00 committed by David Peter
parent 57aed07814
commit 978def2d40
6 changed files with 25 additions and 25 deletions

View File

@ -500,11 +500,11 @@ Example configuration file:
# Use italic text on the terminal (not supported on all terminals)
--italic-text=always
# Use C++ syntax (instead of C) for .h header files
--map-syntax h:cpp
# Use C++ syntax for .ino files
--map-syntax "*.ino:C++"
# Use "gitignore" highlighting for ".ignore" files
--map-syntax .ignore:.gitignore
# Use ".gitignore"-style highlighting for ".ignore" files
--map-syntax ".ignore:Git Ignore"
```
## Using `bat` on Windows

View File

@ -100,12 +100,12 @@ Determine which pager is used. This option will overwrite the PAGER and BAT_PAGE
environment variables. The default pager is 'less'. To disable the pager completely, use
the '\-\-paging' option. Example: '\-\-pager "less \fB\-RF\fR"'.
.HP
\fB\-m\fR, \fB\-\-map\-syntax\fR <from:to>...
\fB\-m\fR, \fB\-\-map\-syntax\fR <glob-pattern:syntax-name>...
.IP
Map a file extension or file name to an existing syntax (specified by a file extension
or file name). For example, to highlight *.build files with the Python syntax, use '\-m
build:py'. To highlight files named '.myignore' with the Git Ignore syntax, use '\-m
\&.myignore:gitignore'.
Map a glob pattern to an existing syntax name. The glob pattern is matched on the full
path and the filename. For example, to highlight *.build files with the Python syntax,
use -m '*.build:Python'. To highlight files named '.myignore' with the Git Ignore
syntax, use -m '.myignore:Git Ignore'.
.HP
\fB\-\-theme\fR <theme>
.IP

View File

@ -500,11 +500,11 @@ export BAT_CONFIG_PATH="/path/to/bat.conf"
# Use italic text on the terminal (not supported on all terminals)
--italic-text=always
# Use C++ syntax (instead of C) for .h header files
--map-syntax h:cpp
# Use C++ syntax for .ino files
--map-syntax "*.ino:C++"
# Use "gitignore" highlighting for ".ignore" files
--map-syntax .ignore:.gitignore
# Use ".gitignore"-style highlighting for ".ignore" files
--map-syntax ".ignore:Git Ignore"
```
## Windows での `bat` の利用

View File

@ -452,11 +452,11 @@ export BAT_CONFIG_PATH="/path/to/bat.conf"
# Use italic text on the terminal (not supported on all terminals)
--italic-text=always
# Use C++ syntax (instead of C) for .h header files
--map-syntax h:cpp
# Use C++ syntax for .ino files
--map-syntax "*.ino:C++"
# Use "gitignore" highlighting for ".ignore" files
--map-syntax .ignore:.gitignore
# Use ".gitignore"-style highlighting for ".ignore" files
--map-syntax ".ignore:Git Ignore"
```
## Windows에서 사용하기

View File

@ -111,7 +111,7 @@ impl App {
let parts: Vec<_> = from_to.split(':').collect();
if parts.len() != 2 {
return Err("Invalid syntax mapping. The format of the -m/--map-syntax option is 'from:to'.".into());
return Err("Invalid syntax mapping. The format of the -m/--map-syntax option is '<glob-pattern>:<syntax-name>'. For example: '*.cpp:C++'.".into());
}
syntax_mapping.insert(parts[0], MappingTarget::MapTo(parts[1]))?;

View File

@ -248,13 +248,13 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
.multiple(true)
.takes_value(true)
.number_of_values(1)
.value_name("from:to")
.help("Map a file extension or name to an existing syntax.")
.value_name("glob:syntax")
.help("Use the specified syntax for files matching the glob pattern ('*.cpp:C++').")
.long_help(
"Map a file extension or file name to an existing syntax (specified by a file \
extension or file name). For example, to highlight *.build files with the \
Python syntax, use '-m build:py'. To highlight files named '.myignore' with \
the Git Ignore syntax, use '-m .myignore:gitignore'.",
"Map a glob pattern to an existing syntax name. The glob pattern is matched \
on the full path and the filename. For example, to highlight *.build files \
with the Python syntax, use -m '*.build:Python'. To highlight files named \
'.myignore' with the Git Ignore syntax, use -m '.myignore:Git Ignore'.",
)
.takes_value(true),
)
@ -281,7 +281,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
.arg(
Arg::with_name("style")
.long("style")
.value_name("style-components")
.value_name("components")
// Need to turn this off for overrides_with to work as we want. See the bottom most
// example at https://docs.rs/clap/2.32.0/clap/struct.Arg.html#method.overrides_with
.use_delimiter(false)