2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: grid
|
|
|
|
layout: command
|
2022-03-04 13:10:09 +01:00
|
|
|
version: 0.59.1
|
2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
Renders the output to a textual terminal grid.
|
|
|
|
|
|
|
|
## Signature
|
|
|
|
|
|
|
|
```> grid --width --color --separator```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
- `--width {int}`: number of terminal columns wide (not output columns)
|
|
|
|
- `--color`: draw output with color
|
|
|
|
- `--separator {string}`: character to separate grid with
|
2022-02-24 13:17:05 +01:00
|
|
|
|
|
|
|
## 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
|
2022-03-03 01:55:03 +01:00
|
|
|
> [[name patch]; [0.1.0 false] [0.1.1 true] [0.2.0 false]] | grid
|
2022-02-24 13:17:05 +01:00
|
|
|
```
|