Skip to content

Commit

Permalink
Refresh command docs for Nu v0.93 (#1379)
Browse files Browse the repository at this point in the history
* Refresh command docs for Nu v0.93

* Refresh command docs for Nu v0.93
  • Loading branch information
hustcer authored May 1, 2024
1 parent 0a7a6e8 commit dbcfd59
Show file tree
Hide file tree
Showing 529 changed files with 1,136 additions and 633 deletions.
1 change: 1 addition & 0 deletions .vuepress/configs/sidebar/command_categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const commandCategories = [
'/commands/categories/network.md',
'/commands/categories/path.md',
'/commands/categories/platform.md',
'/commands/categories/plugin.md',
'/commands/categories/prompt.md',
'/commands/categories/random.md',
'/commands/categories/removed.md',
Expand Down
26 changes: 26 additions & 0 deletions commands/categories/plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Plugin

<script>
import pages from '@temp/pages'
export default {
computed: {
commands() {
return pages
.filter(p => p.path.includes('/commands/docs/'))
.filter(p => p.frontmatter.categories.includes('plugin'))
.sort((a,b) => (a.title > b.title) ? 1 : ((b.title > a.title) ? -1 : 0));
}
}
}
</script>

<table>
<tr>
<th>Command</th>
<th>Description</th>
</tr>
<tr v-for="command in commands">
<td><a :href="$withBase(command.path)">{{ command.title }}</a></td>
<td style="white-space: pre-wrap;">{{ command.frontmatter.usage }}</td>
</tr>
</table>
2 changes: 1 addition & 1 deletion commands/docs/alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: alias
categories: |
core
version: 0.92.0
version: 0.93.0
core: |
Alias a command (with optional flags) to a new name.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/all.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: all
categories: |
filters
version: 0.92.0
version: 0.93.0
filters: |
Test if every element of the input fulfills a predicate expression.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/ansi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: ansi
categories: |
platform
version: 0.92.0
version: 0.93.0
platform: |
Output ANSI codes to change color and style of text.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/ansi_gradient.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: ansi gradient
categories: |
platform
version: 0.92.0
version: 0.93.0
platform: |
Add a color gradient (using ANSI color codes) to the given string.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/ansi_link.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: ansi link
categories: |
platform
version: 0.92.0
version: 0.93.0
platform: |
Add a link (using OSC 8 escape sequence) to the given string.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/ansi_strip.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: ansi strip
categories: |
platform
version: 0.92.0
version: 0.93.0
platform: |
Strip ANSI escape sequences from a string.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/any.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: any
categories: |
filters
version: 0.92.0
version: 0.93.0
filters: |
Tests if any element of the input fulfills a predicate expression.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/append.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: append
categories: |
filters
version: 0.92.0
version: 0.93.0
filters: |
Append any number of rows to a table.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: ast
categories: |
debug
version: 0.92.0
version: 0.93.0
debug: |
Print the abstract syntax tree (ast) for a pipeline.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bits.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bits
categories: |
bits
version: 0.92.0
version: 0.93.0
bits: |
Various commands for working with bits.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bits_and.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bits and
categories: |
bits
version: 0.92.0
version: 0.93.0
bits: |
Performs bitwise and for ints or binary values.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bits_not.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bits not
categories: |
bits
version: 0.92.0
version: 0.93.0
bits: |
Performs logical negation on each bit.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bits_or.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bits or
categories: |
bits
version: 0.92.0
version: 0.93.0
bits: |
Performs bitwise or for ints or binary values.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bits_rol.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bits rol
categories: |
bits
version: 0.92.0
version: 0.93.0
bits: |
Bitwise rotate left for ints or binary values.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bits_ror.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bits ror
categories: |
bits
version: 0.92.0
version: 0.93.0
bits: |
Bitwise rotate right for ints or binary values.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bits_shl.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bits shl
categories: |
bits
version: 0.92.0
version: 0.93.0
bits: |
Bitwise shift left for ints or binary values.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bits_shr.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bits shr
categories: |
bits
version: 0.92.0
version: 0.93.0
bits: |
Bitwise shift right for ints or binary values.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bits_xor.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bits xor
categories: |
bits
version: 0.92.0
version: 0.93.0
bits: |
Performs bitwise xor for ints or binary values.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/break.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: break
categories: |
core
version: 0.92.0
version: 0.93.0
core: |
Break a loop.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Various commands for working with byte data.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes add
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Add specified bytes to the input.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes_at.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes at
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Get bytes defined by a range.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes build
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Create bytes from the arguments.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes_collect.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes collect
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Concatenate multiple binary into a single binary, with an optional separator between each.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes_ends-with.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes ends-with
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Check if bytes ends with a pattern.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes_index-of.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes index-of
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Returns start index of first occurrence of pattern in bytes, or -1 if no match.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes_length.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes length
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Output the length of any bytes in the pipeline.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes_remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes remove
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Remove bytes.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes_replace.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes replace
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Find and replace binary.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes_reverse.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes reverse
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Reverse the bytes in the pipeline.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/bytes_starts-with.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: bytes starts-with
categories: |
bytes
version: 0.92.0
version: 0.93.0
bytes: |
Check if bytes starts with a pattern.
usage: |
Expand Down
4 changes: 2 additions & 2 deletions commands/docs/cal.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: cal
categories: |
generators
version: 0.92.0
version: 0.93.0
generators: |
Display a calendar.
usage: |
Expand Down Expand Up @@ -51,6 +51,6 @@ The calendar for all of 2012

This month's calendar with the week starting on monday
```nu
> cal --week-start monday
> cal --week-start mo
```
2 changes: 1 addition & 1 deletion commands/docs/cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: cd
categories: |
filesystem
version: 0.92.0
version: 0.93.0
filesystem: |
Change directory.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/char.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: char
categories: |
strings
version: 0.92.0
version: 0.93.0
strings: |
Output special characters (e.g., 'newline').
usage: |
Expand Down
2 changes: 1 addition & 1 deletion commands/docs/clear.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: clear
categories: |
platform
version: 0.92.0
version: 0.93.0
platform: |
Clear the terminal.
usage: |
Expand Down
16 changes: 11 additions & 5 deletions commands/docs/collect.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
title: collect
categories: |
filters
version: 0.92.0
version: 0.93.0
filters: |
Collect the stream and pass it to a block.
Collect a stream into a value and then run a closure with the collected value as input.
usage: |
Collect the stream and pass it to a block.
Collect a stream into a value and then run a closure with the collected value as input.
feature: default
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `collect` for [filters](/commands/categories/filters.md)

<div class='command-title'>Collect the stream and pass it to a block.</div>
<div class='command-title'>Collect a stream into a value and then run a closure with the collected value as input.</div>

## Signature

```> collect {flags} (closure)```

## Flags

- `--keep-env, -`: let the block affect environment variables
- `--keep-env, -`: let the closure affect environment variables

## Parameters

Expand All @@ -41,3 +41,9 @@ Use the second value in the stream
> [1 2 3] | collect { |x| $x.1 }
2
```

Read and write to the same file
```nu
> open file.txt | collect { save -f file.txt }
```
Loading

0 comments on commit dbcfd59

Please sign in to comment.