From d061d872c5ecf41ac6ba37b1028a49af80509d02 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 7 Jan 2021 10:44:25 +0000 Subject: [PATCH] update yq cheat sheet --- yq/README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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. -- 2.25.1