Skip to content

Commit

Permalink
Auto merge of #10935 - har7an:patch-1, r=epage
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Aug 4, 2022
2 parents 7259757 + e8cd6f4 commit 5ac9be2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/doc/src/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ c = "check"
t = "test"
r = "run"
rr = "run --release"
recursive_example = "rr --example recursions"
space_example = ["run", "--release", "--", "\"command list\""]

[build]
Expand Down Expand Up @@ -335,6 +336,14 @@ r = "run"

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

Aliases are recursive:

```toml
[alias]
rr = "run --release"
recursive_example = "rr --example recursions"
```

#### `[build]`

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

0 comments on commit 5ac9be2

Please sign in to comment.