summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBenjamin Gilbert <bgilbert@backtick.net>2025-06-23 15:21:20 -0700
committerDylan Baker <dylan@pnwbakers.com>2025-11-18 08:32:28 -0800
commit4b7a494f8227aea2bb8acce8ab40d7d34734971a (patch)
treeb8f92bf1d6bc2cfbf8a7b5a5d4bc50940fc77670 /docs
parent5d3849d065f7397977081cd739b3f839f886611c (diff)
downloadmeson-4b7a494f8227aea2bb8acce8ab40d7d34734971a.tar.gz
rewriter: drop unused command-line arguments for def/kwargs delete
The `default-options delete` and `kwargs delete` subcommands required key/value pairs, where the key was deleted and the specified value was ignored. This matches the JSON script mode interface but is unpleasant as a CLI. Have the CLI `delete` commands accept a list of keys instead. We can make this change because the UI is documented to be unstable. However, to allow scripts to work with both old and new Meson, ignore even-numbered arguments if they're all equal to the empty string. Fixes: #13234
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Rewriter.md19
1 files changed, 16 insertions, 3 deletions
diff --git a/docs/markdown/Rewriter.md b/docs/markdown/Rewriter.md
index 82f86353d..546666f19 100644
--- a/docs/markdown/Rewriter.md
+++ b/docs/markdown/Rewriter.md
@@ -94,7 +94,8 @@ It is also possible to set kwargs of specific functions with the
rewriter. The general command for setting or removing kwargs is:
```bash
-meson rewrite kwargs {set/delete} <function type> <function ID> <key1> <value1> <key2> <value2> ...
+meson rewrite kwargs set <function type> <function ID> <key1> <value1> <key2> <value2> ...
+meson rewrite kwargs delete <function type> <function ID> <key1> <key2> ...
```
For instance, setting the project version can be achieved with this command:
@@ -116,14 +117,23 @@ converted to `/` by msys bash but in order to keep usage
shell-agnostic, the rewrite command also allows `//` as the function
ID such that it will work in both msys bash and other shells.
+*Before 1.10.0*, the `delete` command expected `<key> <value>` pairs as
+in `set`; the `<value>` was ignored. For backward compatibility, Meson
+accepts this syntax with a warning if all `<value>`s are the empty string.
+
### Setting the project default options
For setting and deleting default options, use the following command:
```bash
-meson rewrite default-options {set/delete} <opt1> <value1> <opt2> <value2> ...
+meson rewrite default-options set <opt1> <value1> <opt2> <value2> ...
+meson rewrite default-options delete <opt1> <opt2> ...
```
+*Before 1.10.0*, the `delete` command expected `<opt> <value>` pairs as
+in `set`; the `<value>` was ignored. For backward compatibility, Meson
+accepts this syntax with a warning if all `<value>`s are the empty string.
+
## Limitations
Rewriting a Meson file is not guaranteed to keep the indentation of
@@ -229,6 +239,9 @@ The format for the type `target` is defined as follows:
}
```
+For operation `delete`, the values of the `options` can be anything
+(including `null`).
+
### Default options modification format
The format for the type `default_options` is defined as follows:
@@ -246,7 +259,7 @@ The format for the type `default_options` is defined as follows:
```
For operation `delete`, the values of the `options` can be anything
-(including `null`)
+(including `null`).
## Extracting information