Skip to content

Commit

Permalink
FIX: overlay remove flags (nushell#565)
Browse files Browse the repository at this point in the history
* change "overlay remove"s --keep to --keep-custom

* add an "overlay remove --keep-env" paragraph (EN)

* rephrase the --keep-custom paragraph in overlays

This commit addresses
nushell#565 (comment)

* remove a useless line in --keep-env paragraph

This commit addresses
nushell#565 (comment)

* mention `--keep-env` flag in the related paragraph

This commit addresses
nushell#565 (comment)

Co-authored-by: amtoine <[email protected]>
  • Loading branch information
amtoine and amtoine committed Aug 22, 2022
1 parent 54f8270 commit cc34cf5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
20 changes: 18 additions & 2 deletions book/overlays.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,29 @@ Sometimes, you might want to remove an overlay, but keep all the custom definiti
(spam)> def eggs [] { "eggs" }
(spam)> overlay remove --keep spam
(spam)> overlay remove --keep-custom spam
(zero)> eggs
eggs
```

The `--keep` flag does exactly that.
The `--keep-custom` flag does exactly that.

One can also keep a list of environment variables that were defined inside an overlay, but remove the rest, using the `--keep-env` flag:

```
(zero)> module spam { export def foo [] { "foo" }; export env FOO {"foo"}}
(zero)> overlay add spam
(spam)> overlay remove spam --keep-env [FOO]
(zero)> foo
Error: Can't run executable...
(zero)> $env.FOO
foo
```

## Ordering Overlays

Expand Down
4 changes: 2 additions & 2 deletions zh-CN/book/overlays.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ _0.64 版本新增:_

(spam)> def eggs [] { "eggs" }

(spam)> overlay remove --keep spam
(spam)> overlay remove --keep-custom spam

(zero)> eggs
eggs
```
`--keep` 标志正是用来做这个的。
`--keep-custom` 标志正是用来做这个的。
## 覆层顺序
Expand Down

0 comments on commit cc34cf5

Please sign in to comment.