mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 18:24:57 +08:00
Update document generation script
This commit is contained in:
@@ -2,52 +2,40 @@
|
||||
|
||||
This creates an array using the expression between the square brackets.
|
||||
|
||||
|
||||
## Collect empty
|
||||
|
||||
Running
|
||||
|
||||
```bash
|
||||
yq eval --null-input '[]'
|
||||
```
|
||||
|
||||
will output
|
||||
|
||||
```yaml
|
||||
[]
|
||||
```
|
||||
|
||||
## Collect single
|
||||
|
||||
Running
|
||||
|
||||
```bash
|
||||
yq eval --null-input '["cat"]'
|
||||
```
|
||||
|
||||
will output
|
||||
|
||||
```yaml
|
||||
- cat
|
||||
```
|
||||
|
||||
## Collect many
|
||||
|
||||
Given a sample.yml file of:
|
||||
|
||||
```yaml
|
||||
a: cat
|
||||
b: dog
|
||||
```
|
||||
|
||||
then
|
||||
|
||||
```bash
|
||||
yq eval '[.a, .b]' sample.yml
|
||||
```
|
||||
|
||||
will output
|
||||
|
||||
```yaml
|
||||
- cat
|
||||
- dog
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user