Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change usages of $nu.scope to the scope command. #1406

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions book/line_editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ With that in mind, the desired menu would look like this
description_text: yellow
}
source: { |buffer, position|
$nu.scope.vars
scope variables
| where name =~ $buffer
| sort-by name
| each { |it| {value: $it.name description: $it.type} }
Expand All @@ -775,7 +775,7 @@ With that in mind, the desired menu would look like this
As you can see, the new menu is identical to the `history_menu` previously
described. The only huge difference is the new field called [`source`](/commands/docs/source.md). The
[`source`](/commands/docs/source.md) field is a nushell definition of the values you want to display in the
menu. For this menu we are extracting the data from `$nu.scope.vars` and we
menu. For this menu we are extracting the data from `scope variables` and we
are using it to create records that will be used to populate the menu.

The required structure for the record is the next one
Expand Down
2 changes: 1 addition & 1 deletion de/book/aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Das ist äquivalent zu `ls -l -a`. Deutlich kürzer.

## Alle Aliase auflisten

Die verfügbaren Aliase können mit `$nu.scope.aliases` aufgelistet werden.
Die verfügbaren Aliase können mit `scope aliases` aufgelistet werden.

## Persistenz

Expand Down
2 changes: 1 addition & 1 deletion make_docs.nu
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def generate-command [commands_group command_name] {
# ...
# ];
# ```
# and contains all the categories given by `$nu.scope.commands.category | uniq`
# and contains all the categories given by `scope commands | get category | uniq`
#
# this file is responsible for the sidebar containing the categories that one can see in
#
Expand Down
4 changes: 2 additions & 2 deletions pt-BR/book/line_editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ $env.config = {
description_text: yellow
}
source: { |buffer, position|
$nu.scope.vars
scope variables
| where name =~ $buffer
| sort-by name
| each { |it| {value: $it.name description: $it.type} }
Expand All @@ -611,7 +611,7 @@ $env.config = {
]
...
```
Como você pode ver, o novo menu é idêntico ao `history_menu` descrito anteriormente. A única diferença significativa é o novo campo chamado `source`. O campo `source` é uma definição do Nushell dos valores que você deseja exibir no menu. Para este menu, estamos extraindo os dados de `$nu.scope.vars` e estamos usando esses dados para criar registros que serão usados para popular o menu.
Como você pode ver, o novo menu é idêntico ao `history_menu` descrito anteriormente. A única diferença significativa é o novo campo chamado `source`. O campo `source` é uma definição do Nushell dos valores que você deseja exibir no menu. Para este menu, estamos extraindo os dados de `scope variables` e estamos usando esses dados para criar registros que serão usados para popular o menu.

A estrutura necessária para o registro é a seguinte:

Expand Down
6 changes: 3 additions & 3 deletions zh-CN/book/dataframes.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ int_1,int_2,float_1,float_2,first,second,third,word
有了内存中的 DataFrame,我们就可以开始对 `DataFrame` 进行列操作。

::: tip
如果你想看到所有可用的 DataFrame 命令,你可以使用 `$nu.scope.commands | where category =~ dataframe`。
如果你想看到所有可用的 DataFrame 命令,你可以使用 `scope commands | where category =~ dataframe`。
:::

## 基本聚合
Expand Down Expand Up @@ -469,7 +469,7 @@ Nushell 强大的管道语法允许我们通过从其他 DataFrame 中获取数
现在我们有一个新的系列,它是通过对前一个变量进行基本操作而构建的。

::: tip
如果你想看看你在内存中存储了多少变量,你可以使用`$nu.scope.vars`。
如果你想看看你在内存中存储了多少变量,你可以使用`scope variables`。
:::

让我们重新命名我们之前的系列为 `memorable`
Expand Down Expand Up @@ -846,7 +846,7 @@ Nushell 的管道系统可以帮助你创建非常有趣的工作流程。
要找到所有惰性 Dataframe 操作,你可以使用:

```nu
$nu.scope.commands | where category =~ lazyframe
scope commands | where category =~ lazyframe
```

在定义了你的惰性 Dataframe 后,我们可以开始对它进行链式操作。例如:
Expand Down
4 changes: 2 additions & 2 deletions zh-CN/book/line_editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ let a = (ls | where size > 10MiB)
description_text: yellow
}
source: { |buffer, position|
$nu.scope.vars
scope variables
| where name =~ $buffer
| sort-by name
| each { |it| {value: $it.name description: $it.type} }
Expand All @@ -651,7 +651,7 @@ let a = (ls | where size > 10MiB)
...
```

正如你所看到的,新的菜单与之前描述的`history_menu`是相同的,唯一的区别是新的字段叫`source`。`source`字段是 Nushell 所定义的,它包含了你想在菜单中显示的值。对于这个菜单,我们从`$nu.scope.vars`中提取数据,然后用它来创建记录并填充菜单。
正如你所看到的,新的菜单与之前描述的`history_menu`是相同的,唯一的区别是新的字段叫`source`。`source`字段是 Nushell 所定义的,它包含了你想在菜单中显示的值。对于这个菜单,我们从`scope variables`中提取数据,然后用它来创建记录并填充菜单。

记录所需的结构如下:

Expand Down