Skip to content

Commit 5ac9be2

Browse files
committed
Auto merge of #10935 - har7an:patch-1, r=epage
Mention that aliases are recursive Instead of duplicating portions of commands that are used identically across many aliases, the user can instead reuse any previously defined aliases. ### What does this PR try to resolve? Today I started working with [`xtask`](https://github.com/matklad/cargo-xtask/), which is a build system based on a simple cargo alias: ```toml [alias] xtask = "run --package xtask --" ``` Since the word "xtask" is rather difficult to type in my opinion (at least my left hand struggles quite a bit) I wanted to add another alias, `x` as a shorthand (similar to what `build`, `run`, etc. have by default). Thereby I discovered that I needn't replicate the whole alias, because aliases are recursive. I consulted the docs and couldn't find a mention of this, hence I'm adding it as part of this PR so other users can discover it. ### How should we test and review this PR? I don't think this requires a separate test, it's a minor change to the documentation only. ### Additional information
2 parents 7259757 + e8cd6f4 commit 5ac9be2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/doc/src/reference/config.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ c = "check"
5959
t = "test"
6060
r = "run"
6161
rr = "run --release"
62+
recursive_example = "rr --example recursions"
6263
space_example = ["run", "--release", "--", "\"command list\""]
6364

6465
[build]
@@ -335,6 +336,14 @@ r = "run"
335336

336337
Aliases are not allowed to redefine existing built-in commands.
337338

339+
Aliases are recursive:
340+
341+
```toml
342+
[alias]
343+
rr = "run --release"
344+
recursive_example = "rr --example recursions"
345+
```
346+
338347
#### `[build]`
339348

340349
The `[build]` table controls build-time operations and compiler settings.

0 commit comments

Comments
 (0)