Skip to content

Commit 1312931

Browse files
authored
Refresh commands (#376)
* Consolidate prompt config to the 3rd party prompt chapter * Refresh command docs
1 parent 24f0c85 commit 1312931

File tree

347 files changed

+1473
-1968
lines changed

Some content is hidden

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

347 files changed

+1473
-1968
lines changed

book/commands/alias.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: alias
33
layout: command
4-
version: 0.60.0
4+
version: 0.60.1
55
usage: |
66
Alias a command (with optional flags) to a new name
77
---
@@ -12,17 +12,16 @@ usage: |
1212

1313
## Signature
1414

15-
`> alias (name) (initial_value)`
15+
```> alias (name) (initial_value)```
1616

1717
## Parameters
1818

19-
- `name`: name of the alias
20-
- `initial_value`: equals sign followed by value
19+
- `name`: name of the alias
20+
- `initial_value`: equals sign followed by value
2121

2222
## Examples
2323

2424
Alias ll to ls -l
25-
2625
```shell
2726
> alias ll = ls -l
2827
```

book/commands/all.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: all?
33
layout: command
4-
version: 0.60.0
4+
version: 0.60.1
55
usage: |
66
Test if every element of the input matches a predicate.
77
---
@@ -12,22 +12,20 @@ usage: |
1212

1313
## Signature
1414

15-
`> all? (predicate)`
15+
```> all? (predicate)```
1616

1717
## Parameters
1818

19-
- `predicate`: the predicate that must match
19+
- `predicate`: the predicate that must match
2020

2121
## Examples
2222

2323
Find if services are running
24-
2524
```shell
2625
> echo [[status]; [UP] [UP]] | all? status == UP
2726
```
2827

2928
Check that all values are even
30-
3129
```shell
3230
> echo [2 4 6 8] | all? ($it mod 2) == 0
3331
```

book/commands/ansi.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: ansi
33
layout: command
4-
version: 0.60.0
4+
version: 0.60.1
55
usage: |
66
Output ANSI codes to change color.
77
---
@@ -12,43 +12,38 @@ usage: |
1212

1313
## Signature
1414

15-
`> ansi (code) --escape --osc --list`
15+
```> ansi (code) --escape --osc --list```
1616

1717
## Parameters
1818

19-
- `code`: the name of the code to use like 'green' or 'reset' to reset the color
20-
- `--escape`: escape sequence without the escape character(s)
21-
- `--osc`: operating system command (ocs) escape sequence without the escape character(s)
22-
- `--list`: list available ansi code names
19+
- `code`: the name of the code to use like 'green' or 'reset' to reset the color
20+
- `--escape`: escape sequence without the escape character(s)
21+
- `--osc`: operating system command (ocs) escape sequence without the escape character(s)
22+
- `--list`: list available ansi code names
2323

2424
## Examples
2525

2626
Change color to green
27-
2827
```shell
2928
> ansi green
3029
```
3130

3231
Reset the color
33-
3432
```shell
3533
> ansi reset
3634
```
3735

3836
Use ansi to color text (rb = red bold, gb = green bold, pb = purple bold)
39-
4037
```shell
4138
> echo [(ansi rb) Hello " " (ansi gb) Nu " " (ansi pb) World (ansi reset)] | str collect
4239
```
4340

4441
Use ansi to color text (italic bright yellow on red 'Hello' with green bold 'Nu' and purple bold 'World')
45-
4642
```shell
4743
> echo [(ansi -e '3;93;41m') Hello (ansi reset) " " (ansi gb) Nu " " (ansi pb) World (ansi reset)] | str collect
4844
```
4945

5046
Use ansi to color text with a style (blue on red in bold)
51-
5247
```shell
5348
> $"(ansi -e { fg: '#0000ff' bg: '#ff0000' attr: b })Hello Nu World(ansi reset)"
5449
```

book/commands/ansi_gradient.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: ansi gradient
33
layout: command
4-
version: 0.60.0
4+
version: 0.60.1
55
usage: |
66
draw text with a provided start and end code making a gradient
77
---
@@ -12,38 +12,34 @@ usage: |
1212

1313
## Signature
1414

15-
`> ansi gradient ...column path --fgstart --fgend --bgstart --bgend`
15+
```> ansi gradient ...column path --fgstart --fgend --bgstart --bgend```
1616

1717
## Parameters
1818

19-
- `...column path`: optionally, draw gradients using text from column paths
20-
- `--fgstart {string}`: foreground gradient start color in hex (0x123456)
21-
- `--fgend {string}`: foreground gradient end color in hex
22-
- `--bgstart {string}`: background gradient start color in hex
23-
- `--bgend {string}`: background gradient end color in hex
19+
- `...column path`: optionally, draw gradients using text from column paths
20+
- `--fgstart {string}`: foreground gradient start color in hex (0x123456)
21+
- `--fgend {string}`: foreground gradient end color in hex
22+
- `--bgstart {string}`: background gradient start color in hex
23+
- `--bgend {string}`: background gradient end color in hex
2424

2525
## Examples
2626

2727
draw text in a gradient with foreground start and end colors
28-
2928
```shell
3029
> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff --fgend 0xe81cff
3130
```
3231

3332
draw text in a gradient with foreground start and end colors and background start and end colors
34-
3533
```shell
3634
> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff --fgend 0xe81cff --bgstart 0xe81cff --bgend 0x40c9ff
3735
```
3836

3937
draw text in a gradient by specifying foreground start color - end color is assumed to be black
40-
4138
```shell
4239
> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgstart 0x40c9ff
4340
```
4441

4542
draw text in a gradient by specifying foreground end color - start color is assumed to be black
46-
4743
```shell
4844
> echo 'Hello, Nushell! This is a gradient.' | ansi gradient --fgend 0xe81cff
4945
```

book/commands/ansi_strip.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: ansi strip
33
layout: command
4-
version: 0.60.0
4+
version: 0.60.1
55
usage: |
66
strip ansi escape sequences from string
77
---
@@ -12,16 +12,15 @@ usage: |
1212

1313
## Signature
1414

15-
`> ansi strip ...column path`
15+
```> ansi strip ...column path```
1616

1717
## Parameters
1818

19-
- `...column path`: optionally, remove ansi sequences by column paths
19+
- `...column path`: optionally, remove ansi sequences by column paths
2020

2121
## Examples
2222

2323
strip ansi escape sequences from string
24-
2524
```shell
2625
> echo [ (ansi green) (ansi cursor_on) "hello" ] | str collect | ansi strip
2726
```

book/commands/any.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: any?
33
layout: command
4-
version: 0.60.0
4+
version: 0.60.1
55
usage: |
66
Tests if any element of the input matches a predicate.
77
---
@@ -12,22 +12,20 @@ usage: |
1212

1313
## Signature
1414

15-
`> any? (predicate)`
15+
```> any? (predicate)```
1616

1717
## Parameters
1818

19-
- `predicate`: the predicate that must match
19+
- `predicate`: the predicate that must match
2020

2121
## Examples
2222

2323
Find if a service is not running
24-
2524
```shell
2625
> echo [[status]; [UP] [DOWN] [UP]] | any? status == DOWN
2726
```
2827

2928
Check if any of the values is odd
30-
3129
```shell
3230
> echo [2 4 1 6 8] | any? ($it mod 2) == 1
3331
```

book/commands/append.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: append
33
layout: command
4-
version: 0.60.0
4+
version: 0.60.1
55
usage: |
6-
Append a row to the table.
6+
Append any number of rows to a table.
77
---
88

99
# `{{ $frontmatter.title }}`
@@ -12,28 +12,25 @@ usage: |
1212

1313
## Signature
1414

15-
`> append (row)`
15+
```> append (row)```
1616

1717
## Parameters
1818

19-
- `row`: the row to append
19+
- `row`: the row, list, or table to append
2020

2121
## Examples
2222

2323
Append one Int item
24-
2524
```shell
2625
> [0,1,2,3] | append 4
2726
```
2827

2928
Append three Int items
30-
3129
```shell
3230
> [0,1] | append [2,3,4]
3331
```
3432

3533
Append Ints and Strings
36-
3734
```shell
3835
> [0,1] | append [2,nu,4,shell]
3936
```

book/commands/benchmark.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: benchmark
33
layout: command
4-
version: 0.60.0
4+
version: 0.60.1
55
usage: |
66
Time the running time of a block
77
---
@@ -12,16 +12,15 @@ usage: |
1212

1313
## Signature
1414

15-
`> benchmark (block)`
15+
```> benchmark (block)```
1616

1717
## Parameters
1818

19-
- `block`: the block to run
19+
- `block`: the block to run
2020

2121
## Examples
2222

2323
Benchmarks a command within a block
24-
2524
```shell
2625
> benchmark { sleep 500ms }
2726
```

book/commands/build-string.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: build-string
33
layout: command
4-
version: 0.60.0
4+
version: 0.60.1
55
usage: |
66
Create a string from the arguments.
77
---
@@ -12,22 +12,20 @@ usage: |
1212

1313
## Signature
1414

15-
`> build-string ...rest`
15+
```> build-string ...rest```
1616

1717
## Parameters
1818

19-
- `...rest`: list of string
19+
- `...rest`: list of string
2020

2121
## Examples
2222

2323
Builds a string from letters a b c
24-
2524
```shell
2625
> build-string a b c
2726
```
2827

2928
Builds a string from letters a b c
30-
3129
```shell
3230
> build-string (1 + 2) = one ' ' plus ' ' two
3331
```

book/commands/cal.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: cal
33
layout: command
4-
version: 0.60.0
4+
version: 0.60.1
55
usage: |
66
Display a calendar.
77
---
@@ -12,33 +12,30 @@ usage: |
1212

1313
## Signature
1414

15-
`> cal --year --quarter --month --full-year --week-start --month-names`
15+
```> cal --year --quarter --month --full-year --week-start --month-names```
1616

1717
## Parameters
1818

19-
- `--year`: Display the year column
20-
- `--quarter`: Display the quarter column
21-
- `--month`: Display the month column
22-
- `--full-year {int}`: Display a year-long calendar for the specified year
23-
- `--week-start {string}`: Display the calendar with the specified day as the first day of the week
24-
- `--month-names`: Display the month names instead of integers
19+
- `--year`: Display the year column
20+
- `--quarter`: Display the quarter column
21+
- `--month`: Display the month column
22+
- `--full-year {int}`: Display a year-long calendar for the specified year
23+
- `--week-start {string}`: Display the calendar with the specified day as the first day of the week
24+
- `--month-names`: Display the month names instead of integers
2525

2626
## Examples
2727

2828
This month's calendar
29-
3029
```shell
3130
> cal
3231
```
3332

3433
The calendar for all of 2012
35-
3634
```shell
3735
> cal --full-year 2012
3836
```
3937

4038
This month's calendar with the week starting on monday
41-
4239
```shell
4340
> cal --week-start monday
4441
```

0 commit comments

Comments
 (0)