mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-27 00:47:56 +00:00
Added comment operator examples
This commit is contained in:
parent
60f30f8a48
commit
7f4c8e1c78
@ -108,7 +108,7 @@ will output
|
|||||||
fc: ""
|
fc: ""
|
||||||
```
|
```
|
||||||
|
|
||||||
## Retreive comment - map key example
|
## Retrieve comment - map key example
|
||||||
From the previous example, we know that the comment is on the 'hello' _key_ as a lineComment
|
From the previous example, we know that the comment is on the 'hello' _key_ as a lineComment
|
||||||
|
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
@ -163,7 +163,7 @@ will output
|
|||||||
fc: ""
|
fc: ""
|
||||||
```
|
```
|
||||||
|
|
||||||
## Retreive comment - array example
|
## Retrieve comment - array example
|
||||||
From the previous example, we know that the comment is on the first child as a headComment
|
From the previous example, we know that the comment is on the first child as a headComment
|
||||||
|
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
|
@ -115,7 +115,7 @@ var commentOperatorScenarios = []expressionScenario{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "Retreive comment - map key example",
|
description: "Retrieve comment - map key example",
|
||||||
subdescription: "From the previous example, we know that the comment is on the 'hello' _key_ as a lineComment",
|
subdescription: "From the previous example, we know that the comment is on the 'hello' _key_ as a lineComment",
|
||||||
document: "hello: # hello-world-comment\n message: world",
|
document: "hello: # hello-world-comment\n message: world",
|
||||||
expression: `.hello | key | line_comment`,
|
expression: `.hello | key | line_comment`,
|
||||||
@ -133,7 +133,7 @@ var commentOperatorScenarios = []expressionScenario{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "Retreive comment - array example",
|
description: "Retrieve comment - array example",
|
||||||
subdescription: "From the previous example, we know that the comment is on the first child as a headComment",
|
subdescription: "From the previous example, we know that the comment is on the first child as a headComment",
|
||||||
document: "name:\n # under-name-comment\n - first-array-child",
|
document: "name:\n # under-name-comment\n - first-array-child",
|
||||||
expression: `.name[0] | headComment`,
|
expression: `.name[0] | headComment`,
|
||||||
|
Loading…
Reference in New Issue
Block a user