This commit is contained in:
Mike Farah 2022-04-29 12:16:48 +10:00
parent 3fe9e55f36
commit 27a14ec188
2 changed files with 27 additions and 2 deletions

View File

@ -31,6 +31,29 @@ will output
!!seq
```
## type is an alias for tag
Given a sample.yml file of:
```yaml
a: cat
b: 5
c: 3.2
e: true
f: []
```
then
```bash
yq '.. | type' sample.yml
```
will output
```yaml
!!map
!!str
!!int
!!float
!!bool
!!seq
```
## Set custom tag
Given a sample.yml file of:
```yaml

View File

@ -9,10 +9,12 @@ Note that versions prior to 4.18 require the 'eval/e' command to be specified.&#
{% endhint %}
## Unique array of scalars (string/numbers)
Note that unique maintains the original order of the array.
Given a sample.yml file of:
```yaml
- 1
- 2
- 1
- 3
- 2
```
@ -22,8 +24,8 @@ yq 'unique' sample.yml
```
will output
```yaml
- 1
- 2
- 1
- 3
```