Skip to content

Commit 906d45a

Browse files
authored
Refresh command docs for 0.111 (#2126)
1 parent 976d067 commit 906d45a

612 files changed

Lines changed: 3052 additions & 2582 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

commands/docs/alias.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: alias
33
categories: |
44
core
5-
version: 0.110.0
5+
version: 0.111.0
66
core: |
77
Alias a command (with optional flags) to a new name.
88
usage: |
@@ -33,7 +33,7 @@ contributors: false
3333
| nothing | nothing |
3434
## Examples
3535

36-
Alias ll to ls -l
36+
Alias ll to ls -l.
3737
```nu
3838
> alias ll = ls -l
3939

commands/docs/all.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: all
33
categories: |
44
filters
5-
version: 0.110.0
5+
version: 0.111.0
66
filters: |
77
Test if every element of the input fulfills a predicate expression.
88
usage: |
@@ -32,31 +32,31 @@ contributors: false
3232
| list<any> | bool |
3333
## Examples
3434

35-
Check if a list contains only true values
35+
Check if a list contains only true values.
3636
```nu
3737
> [false true true false] | all {}
3838
false
3939
```
4040

41-
Check if each row's status is the string 'UP'
41+
Check if each row's status is the string 'UP'.
4242
```nu
4343
> [[status]; [UP] [UP]] | all {|el| $el.status == UP }
4444
true
4545
```
4646

47-
Check that each item is a string
47+
Check that each item is a string.
4848
```nu
4949
> [foo bar 2 baz] | all {|| ($in | describe) == 'string' }
5050
false
5151
```
5252

53-
Check that all values are equal to twice their index
53+
Check that all values are equal to twice their index.
5454
```nu
5555
> [0 2 4 6] | enumerate | all {|i| $i.item == $i.index * 2 }
5656
true
5757
```
5858

59-
Check that all of the values are even, using a stored closure
59+
Check that all of the values are even, using a stored closure.
6060
```nu
6161
> let cond = {|el| ($el mod 2) == 0 }; [2 4 6 8] | all $cond
6262
true

commands/docs/ansi.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ansi
33
categories: |
44
platform
5-
version: 0.110.0
5+
version: 0.111.0
66
platform: |
77
Output ANSI codes to change color and style of text.
88
usage: |
@@ -24,7 +24,7 @@ contributors: false
2424

2525
- `--escape, -e`: escape sequence without the escape character(s) ('\x1b[' is not required)
2626
- `--osc, -o`: operating system command (osc) escape sequence without the escape character(s) ('\x1b]' is not required)
27-
- `--list, -l`: list available ansi code names
27+
- `--list, -l`: List available ansi code names.
2828

2929
## Parameters
3030

@@ -91,6 +91,60 @@ Use structured escape codes
9191
Hello, Nu World!
9292
```
9393

94+
Use structured escape codes with attribute name
95+
```nu
96+
> let strike_blue_on_red = {
97+
fg: '#0000ff'
98+
bg: '#ff0000'
99+
attr: strike
100+
}
101+
$"(ansi --escape $strike_blue_on_red)Hello, Nu World!(ansi reset)"
102+
Hello, Nu World!
103+
```
104+
105+
Use structured escape codes with multiple attribute names
106+
```nu
107+
> let bold_italic_blue_on_red = {
108+
fg: '#0000ff'
109+
bg: '#ff0000'
110+
attr: 'bold italic'
111+
}
112+
$"(ansi --escape $bold_italic_blue_on_red)Hello, Nu World!(ansi reset)"
113+
Hello, Nu World!
114+
```
115+
116+
Use structured escape codes with concatenated attribute codes
117+
```nu
118+
> let bold_italic_strike_blue_on_red = {
119+
fg: '#0000ff'
120+
bg: '#ff0000'
121+
attr: bis
122+
}
123+
$"(ansi --escape $bold_italic_strike_blue_on_red)Hello, Nu World!(ansi reset)"
124+
Hello, Nu World!
125+
```
126+
127+
Use structured escape codes with attribute list (comma-separated)
128+
```nu
129+
> let bold_underline_blue = {
130+
fg: '#0000ff'
131+
attr: [b,underline]
132+
}
133+
$"(ansi --escape $bold_underline_blue)Hello, Nu World!(ansi reset)"
134+
Hello, Nu World!
135+
```
136+
137+
Use structured escape codes with multiple attributes in list
138+
```nu
139+
> let styled_text = {
140+
fg: '#0000ff'
141+
bg: '#ff0000'
142+
attr: [bold, italic, strike]
143+
}
144+
$"(ansi --escape $styled_text)Hello, Nu World!(ansi reset)"
145+
Hello, Nu World!
146+
```
147+
94148
## Notes
95149
```text
96150
An introduction to what ANSI escape sequences are can be found in the

commands/docs/ansi_gradient.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ansi gradient
33
categories: |
44
platform
5-
version: 0.110.0
5+
version: 0.111.0
66
platform: |
77
Add a color gradient (using ANSI color codes) to the given string.
88
usage: |
@@ -22,10 +22,10 @@ contributors: false
2222

2323
## Flags
2424

25-
- `--fgstart, -a {string}`: foreground gradient start color in hex (0x123456)
26-
- `--fgend, -b {string}`: foreground gradient end color in hex
27-
- `--bgstart, -c {string}`: background gradient start color in hex
28-
- `--bgend, -d {string}`: background gradient end color in hex
25+
- `--fgstart, -a {string}`: Foreground gradient start color in hex (0x123456).
26+
- `--fgend, -b {string}`: Foreground gradient end color in hex.
27+
- `--bgstart, -c {string}`: Background gradient start color in hex.
28+
- `--bgend, -d {string}`: Background gradient end color in hex.
2929

3030
## Parameters
3131

commands/docs/ansi_link.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ansi link
33
categories: |
44
platform
5-
version: 0.110.0
5+
version: 0.111.0
66
platform: |
77
Add a link (using OSC 8 escape sequence) to the given string.
88
usage: |
@@ -23,7 +23,7 @@ contributors: false
2323
## Flags
2424

2525
- `--text, -t {string}`: Link text. Uses uri as text if absent. In case of
26-
tables, records and lists applies this text to all elements
26+
tables, records and lists applies this text to all elements.
2727

2828
## Parameters
2929

commands/docs/ansi_strip.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ansi strip
33
categories: |
44
platform
5-
version: 0.110.0
5+
version: 0.111.0
66
platform: |
77
Strip ANSI escape sequences from a string.
88
usage: |

commands/docs/any.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: any
33
categories: |
44
filters
5-
version: 0.110.0
5+
version: 0.111.0
66
filters: |
77
Tests if any element of the input fulfills a predicate expression.
88
usage: |
@@ -32,31 +32,31 @@ contributors: false
3232
| list<any> | bool |
3333
## Examples
3434

35-
Check if a list contains any true values
35+
Check if a list contains any true values.
3636
```nu
3737
> [false true true false] | any {}
3838
true
3939
```
4040

41-
Check if any row's status is the string 'DOWN'
41+
Check if any row's status is the string 'DOWN'.
4242
```nu
4343
> [[status]; [UP] [DOWN] [UP]] | any {|el| $el.status == DOWN }
4444
true
4545
```
4646

47-
Check that any item is a string
47+
Check that any item is a string.
4848
```nu
4949
> [1 2 3 4] | any {|| ($in | describe) == 'string' }
5050
false
5151
```
5252

53-
Check if any value is equal to twice its own index
53+
Check if any value is equal to twice its own index.
5454
```nu
5555
> [9 8 7 6] | enumerate | any {|i| $i.item == $i.index * 2 }
5656
true
5757
```
5858

59-
Check if any of the values are odd, using a stored closure
59+
Check if any of the values are odd, using a stored closure.
6060
```nu
6161
> let cond = {|e| $e mod 2 == 1 }; [2 4 1 6 8] | any $cond
6262
true

commands/docs/append.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: append
33
categories: |
44
filters
5-
version: 0.110.0
5+
version: 0.111.0
66
filters: |
77
Append any number of rows to a table.
88
usage: |
@@ -32,7 +32,7 @@ contributors: false
3232
| any | list<any> |
3333
## Examples
3434

35-
Append one int to a list
35+
Append one int to a list.
3636
```nu
3737
> [0 1 2 3] | append 4
3838
╭───┬───╮
@@ -45,7 +45,7 @@ Append one int to a list
4545
4646
```
4747

48-
Append a list to an item
48+
Append a list to an item.
4949
```nu
5050
> 0 | append [1 2 3]
5151
╭───┬───╮
@@ -57,7 +57,7 @@ Append a list to an item
5757
5858
```
5959

60-
Append a list of string to a string
60+
Append a list of string to a string.
6161
```nu
6262
> "a" | append ["b"]
6363
╭───┬───╮
@@ -67,7 +67,7 @@ Append a list of string to a string
6767
6868
```
6969

70-
Append three int items
70+
Append three int items.
7171
```nu
7272
> [0 1] | append [2 3 4]
7373
╭───┬───╮
@@ -80,7 +80,7 @@ Append three int items
8080
8181
```
8282

83-
Append ints and strings
83+
Append ints and strings.
8484
```nu
8585
> [0 1] | append [2 nu 4 shell]
8686
╭───┬───────╮
@@ -94,7 +94,7 @@ Append ints and strings
9494
9595
```
9696

97-
Append a range of ints to a list
97+
Append a range of ints to a list.
9898
```nu
9999
> [0 1] | append 2..4
100100
╭───┬───╮

commands/docs/ast.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ast
33
categories: |
44
debug
5-
version: 0.110.0
5+
version: 0.111.0
66
debug: |
77
Print the abstract syntax tree (ast) for a pipeline.
88
usage: |
@@ -22,9 +22,9 @@ contributors: false
2222

2323
## Flags
2424

25-
- `--json, -j`: Serialize to json
26-
- `--minify, -m`: Minify the nuon or json output
27-
- `--flatten, -f`: An easier to read version of the ast
25+
- `--json, -j`: Serialize to json.
26+
- `--minify, -m`: Minify the nuon or json output.
27+
- `--flatten, -f`: An easier to read version of the ast.
2828

2929
## Parameters
3030

@@ -40,37 +40,37 @@ contributors: false
4040
| nothing | string |
4141
## Examples
4242

43-
Print the ast of a string
43+
Print the ast of a string.
4444
```nu
4545
> ast 'hello'
4646
4747
```
4848

49-
Print the ast of a pipeline
49+
Print the ast of a pipeline.
5050
```nu
5151
> ast 'ls | where name =~ README'
5252
5353
```
5454

55-
Print the ast of a pipeline with an error
55+
Print the ast of a pipeline with an error.
5656
```nu
5757
> ast 'for x in 1..10 { echo $x '
5858
5959
```
6060

61-
Print the ast of a pipeline with an error, as json, in a nushell table
61+
Print the ast of a pipeline with an error, as json, in a nushell table.
6262
```nu
6363
> ast 'for x in 1..10 { echo $x ' --json | get block | from json
6464
6565
```
6666

67-
Print the ast of a pipeline with an error, as json, minified
67+
Print the ast of a pipeline with an error, as json, minified.
6868
```nu
6969
> ast 'for x in 1..10 { echo $x ' --json --minify
7070
7171
```
7272

73-
Print the ast of a string flattened
73+
Print the ast of a string flattened.
7474
```nu
7575
> ast "'hello'" --flatten
7676
╭───┬─────────┬──────────────┬───────────────╮
@@ -84,13 +84,13 @@ Print the ast of a string flattened
8484
8585
```
8686

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

93-
Print the ast of a pipeline flattened
93+
Print the ast of a pipeline flattened.
9494
```nu
9595
> ast 'ls | sort-by type name -i' --flatten
9696
╭───┬─────────┬────────────────────┬────────────────╮

commands/docs/attr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: attr
33
categories: |
44
core
5-
version: 0.110.0
5+
version: 0.111.0
66
core: |
77
Various attributes for custom commands.
88
usage: |

0 commit comments

Comments
 (0)