Skip to content

Commit

Permalink
Update docs and tests for --properties-separator flag
Browse files Browse the repository at this point in the history
  • Loading branch information
suridge authored and mikefarah committed Jan 21, 2025
1 parent 8bf425b commit 1508f1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/yqlib/doc/usage/properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ person.food[0] = pizza
```

## 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:
```yaml
Expand All @@ -89,7 +89,7 @@ emptyMap: []
```
then
```bash
yq -o=props --properties-customer-separator=" :@ " sample.yml
yq -o=props --properties-separator=" :@ " sample.yml
```
will output
```properties
Expand Down
4 changes: 2 additions & 2 deletions pkg/yqlib/properties_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ var propertyScenarios = []formatScenario{
},
{
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,
expected: expectedPropertiesUnwrappedCustomSeparator,
scenarioType: "encode-custom-separator",
Expand Down Expand Up @@ -324,7 +324,7 @@ func documentUnwrappedEncodePropertyScenario(w *bufio.Writer, s formatScenario)
prefs.UseArrayBrackets = true
} else if s.scenarioType == "encode-custom-separator" {
prefs.KeyValueSeparator = " :@ "
useCustomSeparatorFlag = ` --properties-customer-separator=" :@ "`
useCustomSeparatorFlag = ` --properties-separator=" :@ "`
}

if expression != "" {
Expand Down

0 comments on commit 1508f1f

Please sign in to comment.