mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 11:27:52 +02:00
Auto-generate markdown command docs (#4451)
* Finish updating * a couple improvements * Update renames * cleanup examples
This commit is contained in:
@ -1,62 +1,16 @@
|
||||
# wrap
|
||||
---
|
||||
title: wrap
|
||||
layout: command
|
||||
version: 0.59.0
|
||||
---
|
||||
|
||||
Wraps data in a table
|
||||
Wrap the value into a column.
|
||||
|
||||
Syntax: `wrap <column>`
|
||||
## Signature
|
||||
|
||||
```> wrap (name)```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `column`: the (optional) name of the column the data should be stored in.
|
||||
- `name`: the name of the column
|
||||
|
||||
## Examples
|
||||
|
||||
`wrap` will give a name to a column of `<value>` data:
|
||||
|
||||
```shell
|
||||
> ls | get name
|
||||
───┬──────────────
|
||||
# │
|
||||
───┼──────────────
|
||||
0 │ americas.csv
|
||||
1 │ iso.csv
|
||||
───┴──────────────
|
||||
```
|
||||
|
||||
```shell
|
||||
> ls | get name | wrap filename
|
||||
───┬──────────────
|
||||
# │ filename
|
||||
───┼──────────────
|
||||
0 │ americas.csv
|
||||
1 │ iso.csv
|
||||
───┴──────────────
|
||||
```
|
||||
|
||||
`wrap` will encapsulate rows as embedded tables:
|
||||
|
||||
```shell
|
||||
> ls | select name type size
|
||||
───┬──────────────┬──────┬─────────
|
||||
# │ name │ type │ size
|
||||
───┼──────────────┼──────┼─────────
|
||||
0 │ americas.csv │ File │ 317 B
|
||||
1 │ iso.csv │ File │ 20.8 KB
|
||||
───┴──────────────┴──────┴─────────
|
||||
|
||||
> ls | select name type size | each {wrap details}
|
||||
───┬────────────────
|
||||
# │ details
|
||||
───┼────────────────
|
||||
0 │ [table 1 rows]
|
||||
1 │ [table 1 rows]
|
||||
───┴────────────────
|
||||
```
|
||||
|
||||
`wrap` will encapsulate a whole table as an embedded table:
|
||||
|
||||
```shell
|
||||
> ls | wrap files
|
||||
───────┬────────────────
|
||||
files │ [table 2 rows]
|
||||
───────┴────────────────
|
||||
```
|
||||
|
Reference in New Issue
Block a user