mirror of
https://github.com/taigrr/yq
synced 2025-01-18 04:53:17 -08:00
370 B
370 B
Get Keys
Given a sample.yml file of:
a:
b: cat
c: dog
d: frog
then
yq eval '.a | keys' sample.yml
will output
3
Set key style
Given a sample.yml file of:
a:
b: cat
c: dog
d: frog
then
yq eval '(.a | keys) style = 'single'' sample.yml
will output
a:
b: cat
c: dog
d: frog