Skip to content

Commit

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

* Refresh Nu command docs for v0.101

---------

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
  • Loading branch information
hustcer and sholderbach authored Dec 22, 2024
1 parent 8943a68 commit 90b46ce
Show file tree
Hide file tree
Showing 560 changed files with 1,575 additions and 822 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 @@ -10,6 +10,7 @@ export const commandCategories = [
'/commands/categories/date.md',
'/commands/categories/debug.md',
'/commands/categories/default.md',
'/commands/categories/deprecated.md',
'/commands/categories/env.md',
'/commands/categories/expression.md',
'/commands/categories/filesystem.md',
Expand Down
2 changes: 1 addition & 1 deletion commands/categories/deprecated.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<th>Description</th>
</tr>
<tr v-for="command in commands">
<td><a :href="command.path">{{ command.title }}</a></td>
<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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.0
filters: |
Append any number of rows to a table.
usage: |
Expand Down
67 changes: 61 additions & 6 deletions 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.100.0
version: 0.101.0
debug: |
Print the abstract syntax tree (ast) for a pipeline.
usage: |
Expand All @@ -20,8 +20,9 @@ usage: |

## Flags

- `--json, -j`: serialize to json
- `--minify, -m`: minify the nuon or json output
- `--json, -j`: Serialize to json
- `--minify, -m`: Minify the nuon or json output
- `--flatten, -f`: An easier to read version of the ast

## Parameters

Expand All @@ -30,9 +31,9 @@ usage: |

## Input/output types:

| input | output |
| ------ | ------ |
| string | record |
| input | output |
| ------- | ------ |
| nothing | table |

## Examples

Expand Down Expand Up @@ -65,3 +66,57 @@ Print the ast of a pipeline with an error, as json, minified
> ast 'for x in 1..10 { echo $x ' --json --minify
```

Print the ast of a string flattened
```nu
> ast "'hello'" --flatten
╭───┬─────────┬──────────────┬───────────────╮
│ # │ content │ shape │ span │
├───┼─────────┼──────────────┼───────────────┤
│ 0 │ 'hello' │ shape_string │ ╭───────┬───╮ │
│ │ │ │ │ start │ 0 │ │
│ │ │ │ │ end │ 7 │ │
│ │ │ │ ╰───────┴───╯ │
╰───┴─────────┴──────────────┴───────────────╯
```

Print the ast of a string flattened, as json, minified
```nu
> ast "'hello'" --flatten --json --minify
[{"content":"'hello'","shape":"shape_string","span":{"start":0,"end":7}}]
```

Print the ast of a pipeline flattened
```nu
> ast 'ls | sort-by type name -i' --flatten
╭───┬─────────┬────────────────────┬────────────────╮
│ # │ content │ shape │ span │
├───┼─────────┼────────────────────┼────────────────┤
│ 0 │ ls │ shape_external │ ╭───────┬───╮ │
│ │ │ │ │ start │ 0 │ │
│ │ │ │ │ end │ 2 │ │
│ │ │ │ ╰───────┴───╯ │
│ 1 │ | │ shape_pipe │ ╭───────┬───╮ │
│ │ │ │ │ start │ 3 │ │
│ │ │ │ │ end │ 4 │ │
│ │ │ │ ╰───────┴───╯ │
│ 2 │ sort-by │ shape_internalcall │ ╭───────┬────╮ │
│ │ │ │ │ start │ 5 │ │
│ │ │ │ │ end │ 12 │ │
│ │ │ │ ╰───────┴────╯ │
│ 3 │ type │ shape_string │ ╭───────┬────╮ │
│ │ │ │ │ start │ 13 │ │
│ │ │ │ │ end │ 17 │ │
│ │ │ │ ╰───────┴────╯ │
│ 4 │ name │ shape_string │ ╭───────┬────╮ │
│ │ │ │ │ start │ 18 │ │
│ │ │ │ │ end │ 22 │ │
│ │ │ │ ╰───────┴────╯ │
│ 5 │ -i │ shape_flag │ ╭───────┬────╮ │
│ │ │ │ │ start │ 23 │ │
│ │ │ │ │ end │ 25 │ │
│ │ │ │ ╰───────┴────╯ │
╰───┴─────────┴────────────────────┴────────────────╯
```
2 changes: 1 addition & 1 deletion commands/docs/banner.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: banner
categories: |
default
version: 0.100.0
version: 0.101.0
default: |
Print a banner for nushell with information about the project
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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.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.100.0
version: 0.101.0
bytes: |
Check if bytes starts with a pattern.
usage: |
Expand Down
2 changes: 1 addition & 1 deletion 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.100.0
version: 0.101.0
generators: |
Display a calendar.
usage: |
Expand Down
Loading

0 comments on commit 90b46ce

Please sign in to comment.