mirror of
https://github.com/taigrr/yq
synced 2025-01-18 04:53:17 -08:00
Fixed remove comments example
This commit is contained in:
@@ -78,17 +78,22 @@ b: dog # leave this
|
||||
```
|
||||
|
||||
## Remove all comments
|
||||
Note the use of `...` to ensure key nodes are included.
|
||||
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
a: cat # comment
|
||||
# great
|
||||
b: # key comment
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq eval '.. comments=""' sample.yml
|
||||
yq eval '... comments=""' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
a: cat
|
||||
b:
|
||||
```
|
||||
|
||||
## Get line comment
|
||||
|
||||
Reference in New Issue
Block a user