From: AJ ONeal Date: Thu, 7 Jan 2021 10:44:25 +0000 (+0000) Subject: update yq cheat sheet X-Git-Url: https://git.josue.xyz/?a=commitdiff_plain;h=d061d872c5ecf41ac6ba37b1028a49af80509d02;p=webi-installers%2F.git update yq cheat sheet --- diff --git a/yq/README.md b/yq/README.md index da28833..d0b5a56 100644 --- a/yq/README.md +++ b/yq/README.md @@ -3,6 +3,28 @@ title: yq homepage: https://github.com/mikefarah/yq tagline: | yq: a lightweight and portable command-line YAML processor - --- +To update or switch versions, run `webi yq@stable` or `webi yq@beta`, etc. + +## Cheat Sheet + +> `yq` is like [`jq`](../jq), meaning that it's like `sed` for YAML data - you +> can use it to slice and filter and map and transform structured data with the +> same ease that `sed`, `awk`, `grep` and friends let you play with text. + +Usage: `yq e '' ` + +Works with YAML: + +```bash +echo 'name: John' | yq e '.name' - +``` + +Works with JSON: + +```bash +echo '[ { "name": "John" }, { "name": "Jane" } ]' | yq e '.[].name' - +``` + +See for the docs.