mirror of
https://github.com/nushell/nushell.git
synced 2024-11-23 00:43:33 +01:00
add documentation for from-json, from-yaml, history, split-row
This commit is contained in:
parent
5bdda06ca6
commit
c77059f891
33
docs/commands/from-json.md
Normal file
33
docs/commands/from-json.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# from-json
|
||||||
|
|
||||||
|
Parse text as `.json` and create table. Use this when nushell cannot dertermine the input file extension.
|
||||||
|
|
||||||
|
Syntax: `from-json {flags}`
|
||||||
|
|
||||||
|
### Flags:
|
||||||
|
|
||||||
|
--objects
|
||||||
|
treat each line as a separate value
|
||||||
|
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
```shell
|
||||||
|
> open command_from-json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
title: "from-json",
|
||||||
|
type: "command",
|
||||||
|
flags: true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
> open command_from-json | from-json
|
||||||
|
━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━
|
||||||
|
title │ type │ flags
|
||||||
|
───────────┼─────────┼───────
|
||||||
|
from-json │ command │ Yes
|
||||||
|
━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━
|
||||||
|
```
|
24
docs/commands/from-yaml.md
Normal file
24
docs/commands/from-yaml.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# from-yaml
|
||||||
|
|
||||||
|
Parse text as `.yaml/.yml` and create table.
|
||||||
|
|
||||||
|
Syntax: `from-yaml`
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
```shell
|
||||||
|
> open command_from-yaml
|
||||||
|
title: from-yaml
|
||||||
|
type: command
|
||||||
|
flags: false
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
> open command_from-yaml | from-yaml
|
||||||
|
━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━
|
||||||
|
title │ type │ flags
|
||||||
|
───────────┼─────────┼───────
|
||||||
|
from-yaml │ command │ No
|
||||||
|
━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━
|
||||||
|
|
||||||
|
```
|
17
docs/commands/history.md
Normal file
17
docs/commands/history.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# history
|
||||||
|
|
||||||
|
Displays the last 100 commands.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```shell
|
||||||
|
> history
|
||||||
|
━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
# │ <value>
|
||||||
|
────┼───────────────────────────────────────────────────────────────────────────
|
||||||
|
...
|
||||||
|
97 │ ls
|
||||||
|
98 │ ls | where accessed < 1d
|
||||||
|
99 │ cd
|
||||||
|
━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
```
|
34
docs/commands/split-row.md
Normal file
34
docs/commands/split-row.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# split-row
|
||||||
|
|
||||||
|
Split row contents over multiple rows via the separator.
|
||||||
|
|
||||||
|
Syntax: `split-row <separator>`
|
||||||
|
|
||||||
|
### Parameters:
|
||||||
|
* `<separator>` the character that denotes what separates rows
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
We can build a table from a file that looks like this
|
||||||
|
|
||||||
|
```shell
|
||||||
|
> open table.txt
|
||||||
|
4, 0, 2, 0, 7, 8
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
using the `split-row` command.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
open table.txt | split-row ", "
|
||||||
|
━━━┯━━━━━━━━━
|
||||||
|
# │ <value>
|
||||||
|
───┼─────────
|
||||||
|
0 │ 4
|
||||||
|
1 │ 0
|
||||||
|
2 │ 2
|
||||||
|
3 │ 0
|
||||||
|
4 │ 7
|
||||||
|
5 │ 8
|
||||||
|
━━━┷━━━━━━━━━
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user