1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-01 19:02:22 +01:00

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

@@ -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)