Can assign-update tag

This commit is contained in:
Mike Farah
2021-02-11 10:58:40 +11:00
parent 5a1b81cbfc
commit 2a6e423d2d
3 changed files with 51 additions and 11 deletions
+15 -1
View File
@@ -22,7 +22,21 @@ will output
!!seq
```
## Convert numbers to strings
## Set custom tag
Given a sample.yml file of:
```yaml
a: str
```
then
```bash
yq eval '.a tag = "!!mikefarah"' sample.yml
```
will output
```yaml
a: !!mikefarah str
```
## Find numbers and convert them to strings
Given a sample.yml file of:
```yaml
a: cat