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

Refresh docs for nu v0.83 #987

Merged
merged 2 commits into from
Jul 26, 2023
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.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .vuepress/configs/sidebar/command_categories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const commandCategories = [
'/commands/categories/bits.md',
'/commands/categories/bytes.md',
'/commands/categories/conversions.md',
'/commands/categories/core.md',
'/commands/categories/database.md',
Expand Down
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.82.0
version: 0.83.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.82.0
version: 0.83.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.82.0
version: 0.83.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.82.0
version: 0.83.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.82.0
version: 0.83.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.82.0
version: 0.83.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.82.0
version: 0.83.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.82.0
version: 0.83.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.82.0
version: 0.83.0
debug: |
Print the abstract syntax tree (ast) for a pipeline.
usage: |
Expand Down
21 changes: 21 additions & 0 deletions commands/docs/bits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: bits
categories: |
bits
version: 0.83.0
bits: |
Various commands for working with bits.
usage: |
Various commands for working with bits.
---

# <code>{{ $frontmatter.title }}</code> for bits

<div class='command-title'>{{ $frontmatter.bits }}</div>

## Signature

```> bits ```

## Notes
You must use one of the following subcommands. Using this command as-is will only produce this help message.
41 changes: 41 additions & 0 deletions commands/docs/bits_and.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: bits and
categories: |
bits
version: 0.83.0
bits: |
Performs bitwise and for integers.
usage: |
Performs bitwise and for integers.
---

# <code>{{ $frontmatter.title }}</code> for bits

<div class='command-title'>{{ $frontmatter.bits }}</div>

## Signature

```> bits and (target)```

## Parameters

- `target`: target integer to perform bit and

## Examples

Apply bits and to two numbers
```shell
> 2 | bits and 2
2
```

Apply logical and to a list of numbers
```shell
> [4 3 2] | bits and 2
╭───┬───╮
│ 0 │ 0 │
│ 1 │ 2 │
│ 2 │ 2 │
╰───┴───╯

```
58 changes: 58 additions & 0 deletions commands/docs/bits_not.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: bits not
categories: |
bits
version: 0.83.0
bits: |
Performs logical negation on each bit.
usage: |
Performs logical negation on each bit.
---

# <code>{{ $frontmatter.title }}</code> for bits

<div class='command-title'>{{ $frontmatter.bits }}</div>

## Signature

```> bits not --signed --number-bytes```

## Parameters

- `--signed` `(-s)`: always treat input number as a signed number
- `--number-bytes {string}`: the size of unsigned number in bytes, it can be 1, 2, 4, 8, auto

## Examples

Apply logical negation to a list of numbers
```shell
> [4 3 2] | bits not
╭───┬─────────────────╮
│ 0 │ 140737488355323 │
│ 1 │ 140737488355324 │
│ 2 │ 140737488355325 │
╰───┴─────────────────╯

```

Apply logical negation to a list of numbers, treat input as 2 bytes number
```shell
> [4 3 2] | bits not -n '2'
╭───┬───────╮
│ 0 │ 65531 │
│ 1 │ 65532 │
│ 2 │ 65533 │
╰───┴───────╯

```

Apply logical negation to a list of numbers, treat input as signed number
```shell
> [4 3 2] | bits not -s
╭───┬────╮
│ 0 │ -5 │
│ 1 │ -4 │
│ 2 │ -3 │
╰───┴────╯

```
41 changes: 41 additions & 0 deletions commands/docs/bits_or.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: bits or
categories: |
bits
version: 0.83.0
bits: |
Performs bitwise or for integers.
usage: |
Performs bitwise or for integers.
---

# <code>{{ $frontmatter.title }}</code> for bits

<div class='command-title'>{{ $frontmatter.bits }}</div>

## Signature

```> bits or (target)```

## Parameters

- `target`: target integer to perform bit or

## Examples

Apply bits or to two numbers
```shell
> 2 | bits or 6
6
```

Apply logical or to a list of numbers
```shell
> [8 3 2] | bits or 2
╭───┬────╮
│ 0 │ 10 │
│ 1 │ 3 │
│ 2 │ 2 │
╰───┴────╯

```
43 changes: 43 additions & 0 deletions commands/docs/bits_rol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: bits rol
categories: |
bits
version: 0.83.0
bits: |
Bitwise rotate left for integers.
usage: |
Bitwise rotate left for integers.
---

# <code>{{ $frontmatter.title }}</code> for bits

<div class='command-title'>{{ $frontmatter.bits }}</div>

## Signature

```> bits rol (bits) --signed --number-bytes```

## Parameters

- `bits`: number of bits to rotate left
- `--signed` `(-s)`: always treat input number as a signed number
- `--number-bytes {string}`: the word size in number of bytes, it can be 1, 2, 4, 8, auto, default value `8`

## Examples

Rotate left a number with 2 bits
```shell
> 17 | bits rol 2
68
```

Rotate left a list of numbers with 2 bits
```shell
> [5 3 2] | bits rol 2
╭───┬────╮
│ 0 │ 20 │
│ 1 │ 12 │
│ 2 │ 8 │
╰───┴────╯

```
43 changes: 43 additions & 0 deletions commands/docs/bits_ror.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: bits ror
categories: |
bits
version: 0.83.0
bits: |
Bitwise rotate right for integers.
usage: |
Bitwise rotate right for integers.
---

# <code>{{ $frontmatter.title }}</code> for bits

<div class='command-title'>{{ $frontmatter.bits }}</div>

## Signature

```> bits ror (bits) --signed --number-bytes```

## Parameters

- `bits`: number of bits to rotate right
- `--signed` `(-s)`: always treat input number as a signed number
- `--number-bytes {string}`: the word size in number of bytes, it can be 1, 2, 4, 8, auto, default value `8`

## Examples

Rotate right a number with 60 bits
```shell
> 17 | bits ror 60
272
```

Rotate right a list of numbers of one byte
```shell
> [15 33 92] | bits ror 2 -n '1'
╭───┬─────╮
│ 0 │ 195 │
│ 1 │ 72 │
│ 2 │ 23 │
╰───┴─────╯

```
55 changes: 55 additions & 0 deletions commands/docs/bits_shl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: bits shl
categories: |
bits
version: 0.83.0
bits: |
Bitwise shift left for integers.
usage: |
Bitwise shift left for integers.
---

# <code>{{ $frontmatter.title }}</code> for bits

<div class='command-title'>{{ $frontmatter.bits }}</div>

## Signature

```> bits shl (bits) --signed --number-bytes```

## Parameters

- `bits`: number of bits to shift left
- `--signed` `(-s)`: always treat input number as a signed number
- `--number-bytes {string}`: the word size in number of bytes, it can be 1, 2, 4, 8, auto, default value `8`

## Examples

Shift left a number by 7 bits
```shell
> 2 | bits shl 7
256
```

Shift left a number with 1 byte by 7 bits
```shell
> 2 | bits shl 7 -n '1'
0
```

Shift left a signed number by 1 bit
```shell
> 0x7F | bits shl 1 -s
254
```

Shift left a list of numbers
```shell
> [5 3 2] | bits shl 2
╭───┬────╮
│ 0 │ 20 │
│ 1 │ 12 │
│ 2 │ 8 │
╰───┴────╯

```