This issue is non-actionable, and is meant to collect use-cases for piping.
Add --- header to all assets. onyo get allowed me to get a list of all assets git grep and find would both have required that I filter through .anchor files, .onyo/ files, etc.
onyo get --keys path -H | xargs -d "\n" grep -L '\-\-\-' | xargs -d "\n" sed -i '1 i\---'
Get a list of all manufacturers:
onyo get --keys make -s make --machine-readable | uniq
Count and sort the number of each type of asset we have.
onyo get --keys type -s type --machine-readable | uniq -c | sort -h
Unroll our faux dot-notation hack in all assets and templates (#675 would have been useful here)
# search for all keys that have a `.` in them
$ git grep -h '.*\..*:' | sed 's/:.*//g' | sort | uniq -c
263 model.name
73 model.year
# replace "model." with indentation (and make sure the file has a "model:" key)
# assets first
onyo get --machine-readable --keys path | xargs -d "\n" grep -l 'model:' | xargs -d "\n" sed -i 's/model\./ /g'
# then templates
git grep -l 'model\.' .onyo/templates/ | xargs -d "\n" grep -l 'model:' | xargs -d "\n" sed -i 's/model\./ /g'
# verify no templates or assets match
$ git grep -l 'model\.'
.onyo/config
README.md
This issue is non-actionable, and is meant to collect use-cases for piping.
Add
---
header to all assets.onyo get
allowed me to get a list of all assetsgit grep
andfind
would both have required that I filter through.anchor
files,.onyo/
files, etc.Get a list of all manufacturers:
Count and sort the number of each type of asset we have.
Get the model year of all Apple laptops.
Attempt to assemble a list of all keys used. This is both complicated, and does not account for dictionaries. We need an onyo command for this (#679).
Unroll our faux dot-notation hack in all assets and templates (#675 would have been useful here)