mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Updating docs
This commit is contained in:
parent
78af68f436
commit
09c5ed24be
@ -1,4 +1,4 @@
|
|||||||
This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structurse.
|
This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structures.
|
||||||
## Simple map navigation
|
## Simple map navigation
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
```yaml
|
```yaml
|
||||||
@ -63,7 +63,7 @@ will output
|
|||||||
frog
|
frog
|
||||||
```
|
```
|
||||||
|
|
||||||
## Multiple special characters
|
## Nested special characters
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
```yaml
|
```yaml
|
||||||
a:
|
a:
|
||||||
@ -230,8 +230,7 @@ will output
|
|||||||
## Traversing nested arrays by index
|
## Traversing nested arrays by index
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
```yaml
|
```yaml
|
||||||
- []
|
[[], [cat]]
|
||||||
- - cat
|
|
||||||
```
|
```
|
||||||
then
|
then
|
||||||
```bash
|
```bash
|
||||||
|
@ -1 +1 @@
|
|||||||
This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structurse.
|
This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structures.
|
@ -78,7 +78,7 @@ var traversePathOperatorScenarios = []expressionScenario{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "Multiple special characters",
|
description: "Nested special characters",
|
||||||
document: `a: {"key.withdots": {"another.key": apple}}`,
|
document: `a: {"key.withdots": {"another.key": apple}}`,
|
||||||
expression: `.a["key.withdots"]["another.key"]`,
|
expression: `.a["key.withdots"]["another.key"]`,
|
||||||
expected: []string{
|
expected: []string{
|
||||||
@ -253,9 +253,10 @@ var traversePathOperatorScenarios = []expressionScenario{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "Traversing nested arrays by index",
|
description: "Traversing nested arrays by index",
|
||||||
document: `[[], [cat]]`,
|
dontFormatInputForDoc: true,
|
||||||
expression: `.[1][0]`,
|
document: `[[], [cat]]`,
|
||||||
|
expression: `.[1][0]`,
|
||||||
expected: []string{
|
expected: []string{
|
||||||
"D0, P[1 0], (!!str)::cat\n",
|
"D0, P[1 0], (!!str)::cat\n",
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user