Auto-generate markdown command docs (#4451)

* Finish updating

* a couple improvements

* Update renames

* cleanup examples
This commit is contained in:
JT
2022-02-13 21:22:51 -05:00
committed by GitHub
parent 06f5affc0b
commit 8c0a2d3c15
478 changed files with 7676 additions and 8045 deletions

View File

@ -1,63 +1,40 @@
# get
---
title: get
layout: command
version: 0.59.0
---
Open given cells as text.
Extract data using a cell path.
Syntax: `get ...args`
## Signature
```> get (cell_path) ...rest --ignore-errors```
## Parameters
* `args`: optionally return additional data by path
- `cell_path`: the cell path to the data
- `...rest`: additional cell paths
- `--ignore-errors`: return nothing if path can't be found
## Examples
If we run `sys` we receive a table which contains tables itself:
Extract the name of files as a list
```shell
> sys
─────────┬─────────────────────────────────────────
host │ [row 7 columns]
cpu │ [row cores current ghz max ghz min ghz]
disks │ [table 4 rows]
mem │ [row free swap free swap total total]
net │ [table 19 rows]
battery │ [table 1 rows]
─────────┴─────────────────────────────────────────
> ls | get name
```
To access one of the embedded tables we can use the `get` command
Extract the name of the 3rd entry of a file list
```shell
> ls | get name.2
```
Extract the name of the 3rd entry of a file list (alternative)
```shell
> ls | get 2.name
```
Extract the cpu list from the sys information record
```shell
> sys | get cpu
─────────────┬────────
cores │ 16
current ghz │ 2.4000
min ghz │ 2.4000
max ghz │ 2.4000
─────────────┴────────
```
```shell
> sys | get battery
───────────────┬──────────
vendor │ DSY
model │ bq40z651
cycles │ 43
mins to empty │ 70.0000
───────────────┴──────────
```
There's also the ability to pass multiple parameters to `get` which results in an output like this
```shell
sys | get cpu battery
───┬───────┬─────────────┬─────────┬─────────
# │ cores │ current ghz │ min ghz │ max ghz
───┼───────┼─────────────┼─────────┼─────────
016 │ 2.4000 │ 2.4000 │ 2.4000
───┴───────┴─────────────┴─────────┴─────────
───┬────────┬──────────┬────────┬───────────────
# │ vendor │ model │ cycles │ mins to empty
───┼────────┼──────────┼────────┼───────────────
1 │ DSY │ bq40z651 │ 43 │ 70.0000
───┴────────┴──────────┴────────┴───────────────
```