mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 20:07:42 +02:00
Add example for command n,g,p and grid, update date now examples (#4622)
This commit is contained in:
@ -15,3 +15,30 @@ Renders the output to a textual terminal grid.
|
||||
- `--width {int}`: number of terminal columns wide (not output columns)
|
||||
- `--color`: draw output with color
|
||||
- `--separator {string}`: character to separate grid with
|
||||
|
||||
## Examples
|
||||
|
||||
Render a simple list to a grid
|
||||
```shell
|
||||
> [1 2 3 a b c] | grid
|
||||
```
|
||||
|
||||
The above example is the same as:
|
||||
```shell
|
||||
> [1 2 3 a b c] | wrap name | grid
|
||||
```
|
||||
|
||||
Render a record to a grid
|
||||
```shell
|
||||
> {name: 'foo', b: 1, c: 2} | grid
|
||||
```
|
||||
|
||||
Render a list of records to a grid
|
||||
```shell
|
||||
> [{name: 'A', v: 1} {name: 'B', v: 2} {name: 'C', v: 3}] | grid
|
||||
```
|
||||
|
||||
Render a table with 'name' column in it to a grid
|
||||
```shell
|
||||
> [[name patch]; [0.1.0 $false] [0.1.1 $true] [0.2.0 $false]] | grid
|
||||
```
|
||||
|
Reference in New Issue
Block a user