Rename 'bat cache --init' to 'bat cache --build'

This commit is contained in:
sharkdp 2019-02-07 22:31:37 +01:00 committed by David Peter
parent 31608c9a03
commit cff01d81fa
6 changed files with 17 additions and 17 deletions

View File

@ -281,7 +281,7 @@ git clone https://github.com/tellnobody1/sublime-purescript-syntax
Now use the following command to parse these files into a binary cache:
```bash
bat cache --init
bat cache --build
```
Finally, use `bat --list-languages` to check if the new languages are available.
@ -305,7 +305,7 @@ cd "$(bat cache --config-dir)/themes"
git clone https://github.com/greggb/sublime-snazzy
# Update the binary cache
bat cache --init
bat cache --build
```
Finally, use `bat --list-themes` to check if the new themes are available.

2
assets/README.md vendored
View File

@ -13,7 +13,7 @@ In order to add new syntaxes to `bat`, follow these steps:
Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
*New Syntax from XXX.tmLanguage...*. Save the new file in the `assets/syntaxes` folder.
3. Run the `create.sh` script. It calls `bat cache --init` to parse all available
3. Run the `create.sh` script. It calls `bat cache --build` to parse all available
`.sublime-syntax` files and serialize them to a `syntaxes.bin` file (in this folder).
4. Re-compile `bat`. At compilation time, the `syntaxes.bin` file will be stored inside the

2
assets/create.sh vendored
View File

@ -11,6 +11,6 @@ JAVADOC_FILE="${ASSET_DIR}/syntaxes/Packages/Java/JavaDoc.sublime-syntax"
JAVADOC_PATCH="${ASSET_DIR}/JavaDoc.sublime-syntax.patch"
patch "$JAVADOC_FILE" "$JAVADOC_PATCH"
bat cache --init --blank --source="$ASSET_DIR" --target="$ASSET_DIR"
bat cache --build --blank --source="$ASSET_DIR" --target="$ASSET_DIR"
patch -R "$JAVADOC_FILE" "$JAVADOC_PATCH"

View File

@ -274,7 +274,7 @@ git clone https://github.com/tellnobody1/sublime-purescript-syntax
次のコマンドを使用して、これらのファイルをバイナリキャッシュに解析します:
```bash
bat cache --init
bat cache --build
```
最後に `bat --list-languages` と入力すると新しい言語が利用可能かどうかチェックします。
@ -297,7 +297,7 @@ cd "$(bat cache --config-dir)/themes"
git clone https://github.com/greggb/sublime-snazzy
# Update the binary cache
bat cache --init
bat cache --build
```
最後に、 `bat --list-themes` で新しいテーマが利用可能がチェックします

View File

@ -353,13 +353,13 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
SubCommand::with_name("cache")
.about("Modify the syntax-definition and theme cache")
.arg(
Arg::with_name("init")
.long("init")
.short("i")
.help("Initialize the syntax/theme cache.")
Arg::with_name("build")
.long("build")
.short("b")
.help("Initialize (or update) the syntax/theme cache.")
.long_help(
"Initialize the syntax/theme cache by loading from the \
source directory (default: the configuration directory).",
"Initialize (or update) the syntax/theme cache by loading from \
the source directory (default: the configuration directory).",
),
)
.arg(
@ -381,13 +381,13 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
)
.group(
ArgGroup::with_name("cache-actions")
.args(&["init", "clear", "config-dir", "cache-dir"])
.args(&["build", "clear", "config-dir", "cache-dir"])
.required(arg_group_required),
)
.arg(
Arg::with_name("source")
.long("source")
.requires("init")
.requires("build")
.takes_value(true)
.value_name("dir")
.help("Use a different directory to load syntaxes and themes from."),
@ -395,14 +395,14 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
.arg(
Arg::with_name("target")
.long("target")
.requires("init")
.requires("build")
.takes_value(true)
.value_name("dir")
.help(
"Use a different directory to store the cached syntax and theme set.",
),
)
.arg(Arg::with_name("blank").long("blank").requires("init").help(
.arg(Arg::with_name("blank").long("blank").requires("build").help(
"Create completely new syntax and theme sets \
(instead of appending to the default sets).",
)),

View File

@ -86,7 +86,7 @@ mod errors {
use errors::*;
fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
if matches.is_present("init") {
if matches.is_present("build") {
let source_dir = matches.value_of("source").map(Path::new);
let target_dir = matches.value_of("target").map(Path::new);