mirror of
https://github.com/nushell/nushell
synced 2024-12-26 04:53:09 +00:00
Basic documentation for the wrap command (#1704)
This commit is contained in:
parent
8d69c77989
commit
d7d487de73
1 changed files with 61 additions and 0 deletions
61
docs/commands/wrap.md
Normal file
61
docs/commands/wrap.md
Normal file
|
@ -0,0 +1,61 @@
|
|||
# wrap
|
||||
|
||||
Wraps data in a table
|
||||
|
||||
Syntax: `wrap <column>`
|
||||
|
||||
## Parameters
|
||||
|
||||
- `column`: the (optional) name of the column the data should be stored in.
|
||||
|
||||
## Examples
|
||||
|
||||
`wrap` will give a name to a column of `<value>` data:
|
||||
|
||||
```shell
|
||||
/home/chris> ls | get name
|
||||
───┬──────────────
|
||||
# │ <value>
|
||||
───┼──────────────
|
||||
0 │ americas.csv
|
||||
1 │ iso.csv
|
||||
───┴──────────────
|
||||
|
||||
/home/chris> ls | get name | wrap filename
|
||||
───┬──────────────
|
||||
# │ filename
|
||||
───┼──────────────
|
||||
0 │ americas.csv
|
||||
1 │ iso.csv
|
||||
───┴──────────────
|
||||
```
|
||||
|
||||
`wrap` will encapsulate rows as embedded tables :
|
||||
|
||||
```shell
|
||||
/home/chris> ls | pick name type size
|
||||
───┬──────────────┬──────┬─────────
|
||||
# │ name │ type │ size
|
||||
───┼──────────────┼──────┼─────────
|
||||
0 │ americas.csv │ File │ 317 B
|
||||
1 │ iso.csv │ File │ 20.8 KB
|
||||
───┴──────────────┴──────┴─────────
|
||||
|
||||
/home/chris> ls | pick 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
|
||||
/home/chris> ls | wrap files
|
||||
───────┬────────────────
|
||||
files │ [table 2 rows]
|
||||
───────┴────────────────
|
||||
```
|
||||
|
Loading…
Reference in a new issue