From 0c6484f3a9fae96c4a227325059c29f4a8410244 Mon Sep 17 00:00:00 2001 From: Joey Teng Date: Wed, 11 Oct 2023 20:56:35 +0100 Subject: [PATCH] Add version to attributes (#1694) --- README.md | 22 +++++++++++----------- README.中文.md | 22 ++++++++++++---------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7145ab3..f385d55 100644 --- a/README.md +++ b/README.md @@ -1241,15 +1241,15 @@ These functions can fail, for example if a path does not have an extension, whic Recipes may be annotated with attributes that change their behavior. -| Name | Description | -| ------------------- | ----------------------------------------------- | -| `[no-cd]` | Don't change directory before executing recipe. | -| `[no-exit-message]` | Don't print an error message if recipe fails. | -| `[linux]` | Enable recipe on Linux. | -| `[macos]` | Enable recipe on MacOS. | -| `[unix]` | Enable recipe on Unixes. (Includes MacOS). | -| `[windows]` | Enable recipe on Windows. | -| `[private]` | See [Private Recipes](#private-recipes). | +| Name | Description | +| ----------------------------------- | ----------------------------------------------- | +| `[no-cd]`1.9.0 | Don't change directory before executing recipe. | +| `[no-exit-message]`1.7.0 | Don't print an error message if recipe fails. | +| `[linux]`1.8.0 | Enable recipe on Linux. | +| `[macos]`1.8.0 | Enable recipe on MacOS. | +| `[unix]`1.8.0 | Enable recipe on Unixes. (Includes MacOS). | +| `[windows]`1.8.0 | Enable recipe on Windows. | +| `[private]`1.10.0 | See [Private Recipes](#private-recipes). | A recipe can have multiple attributes, either on multiple lines: @@ -1268,7 +1268,7 @@ foo: echo "foo" ``` -#### Enabling and Disabling Recipes +#### Enabling and Disabling Recipes1.8.0 The `[linux]`, `[macos]`, `[unix]`, and `[windows]` attributes are configuration attributes. By default, recipes are always enabled. A recipe with @@ -2168,7 +2168,7 @@ Bar! ``` `just` normally prints error messages when a recipe line fails. These error -messages can be suppressed using the `[no-exit-message]` attribute. You may find +messages can be suppressed using the `[no-exit-message]`1.7.0 attribute. You may find this especially useful with a recipe that recipe wraps a tool: ```just diff --git a/README.中文.md b/README.中文.md index 473af4a..54e04fd 100644 --- a/README.中文.md +++ b/README.中文.md @@ -1201,16 +1201,18 @@ The executable is at: /bin/just 配方可以通过添加属性注释来改变其行为。 -| 名称 | 描述 | -| ------------------- | -------------------------------------- | -| `[no-cd]` | 在执行配方之前不要改变目录。 | -| `[no-exit-message]` | 如果配方执行失败,不要打印错误信息。 | -| `[linux]` | 在Linux上启用配方。 | -| `[macos]` | 在MacOS上启用配方。 | -| `[unix]` | 在Unixes上启用配方。 | -| `[windows]` | 在Windows上启用配方。 | -#### 启用和禁用配方 +| 名称 | 描述 | +| ----------------------------------- | -------------------------------------- | +| `[no-cd]`1.9.0 | 在执行配方之前不要改变目录。 | +| `[no-exit-message]`1.7.0 | 如果配方执行失败,不要打印错误信息。 | +| `[linux]`1.8.0 | 在Linux上启用配方。 | +| `[macos]`1.8.0 | 在MacOS上启用配方。 | +| `[unix]`1.8.0 | 在Unixes上启用配方。 | +| `[windows]`1.8.0 | 在Windows上启用配方。 | +| `[private]`1.10.0 | 参见 [私有配方](#私有配方). | + +#### 启用和禁用配方1.8.0 `[linux]`, `[macos]`, `[unix]` 和 `[windows]` 属性是配置属性。默认情况下,配方总是被启用。一个带有一个或多个配置属性的配方只有在其中一个或多个配置处于激活状态时才会被启用。 @@ -2050,7 +2052,7 @@ echo 'Bar!' Bar! ``` -`just` 在配方行失败时通常会打印错误信息,这些错误信息可以通过 `[no-exit-message]` 属性来抑制。你可能会发现这在包装工具的配方中特别有用: +`just` 在配方行失败时通常会打印错误信息,这些错误信息可以通过 `[no-exit-message]`1.7.0 属性来抑制。你可能会发现这在包装工具的配方中特别有用: ```just git *args: