mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-23 22:25:42 +00:00
Update docs and tests for --properties-separator flag
This commit is contained in:
parent
8bf425b4d1
commit
1508f1fd5f
@ -71,7 +71,7 @@ person.food[0] = pizza
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Encode properties - custom separator
|
## Encode properties - custom separator
|
||||||
Use the --properties-customer-separator flag to specify your own key/value separator.
|
Use the --properties-separator flag to specify your own key/value separator.
|
||||||
|
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
```yaml
|
```yaml
|
||||||
@ -89,7 +89,7 @@ emptyMap: []
|
|||||||
```
|
```
|
||||||
then
|
then
|
||||||
```bash
|
```bash
|
||||||
yq -o=props --properties-customer-separator=" :@ " sample.yml
|
yq -o=props --properties-separator=" :@ " sample.yml
|
||||||
```
|
```
|
||||||
will output
|
will output
|
||||||
```properties
|
```properties
|
||||||
|
@ -171,7 +171,7 @@ var propertyScenarios = []formatScenario{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "Encode properties - custom separator",
|
description: "Encode properties - custom separator",
|
||||||
subdescription: "Use the --properties-customer-separator flag to specify your own key/value separator.",
|
subdescription: "Use the --properties-separator flag to specify your own key/value separator.",
|
||||||
input: samplePropertiesYaml,
|
input: samplePropertiesYaml,
|
||||||
expected: expectedPropertiesUnwrappedCustomSeparator,
|
expected: expectedPropertiesUnwrappedCustomSeparator,
|
||||||
scenarioType: "encode-custom-separator",
|
scenarioType: "encode-custom-separator",
|
||||||
@ -324,7 +324,7 @@ func documentUnwrappedEncodePropertyScenario(w *bufio.Writer, s formatScenario)
|
|||||||
prefs.UseArrayBrackets = true
|
prefs.UseArrayBrackets = true
|
||||||
} else if s.scenarioType == "encode-custom-separator" {
|
} else if s.scenarioType == "encode-custom-separator" {
|
||||||
prefs.KeyValueSeparator = " :@ "
|
prefs.KeyValueSeparator = " :@ "
|
||||||
useCustomSeparatorFlag = ` --properties-customer-separator=" :@ "`
|
useCustomSeparatorFlag = ` --properties-separator=" :@ "`
|
||||||
}
|
}
|
||||||
|
|
||||||
if expression != "" {
|
if expression != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user