fixing property comment handling

This commit is contained in:
Mike Farah
2022-10-26 13:12:30 +11:00
parent 2e588a11a0
commit 23b2aa5668
6 changed files with 20 additions and 7 deletions
+6 -2
View File
@@ -154,7 +154,9 @@ will output
cool: things
more_stuff:
this:
is: a properties file
is: a properties file # great huh
# things and stuff
another: a properties file # another thing
```
## Merge from properties
@@ -173,8 +175,10 @@ yq '. *= load_props("../../examples/small.properties")' sample.yml
will output
```yaml
this:
is: a properties file
is: a properties file # great huh
# things and stuff
cool: ay
another: a properties file # another thing
```
## Load from base64 encoded file
+3 -1
View File
@@ -139,7 +139,8 @@ yq -p=props sample.properties
will output
```yaml
person:
name: Mike Wazowski # comments on values appear
name: Mike Wazowski # block comments come through
# comments on values appear
pets:
- cat # comments on array values appear
food:
@@ -164,6 +165,7 @@ yq -p=props -o=props '.person.pets.0 = "dog"' sample.properties
```
will output
```properties
# block comments come through
# comments on values appear
person.name = Mike Wazowski