From 1642a3c1e2fa9eb68cf370f82a2833286023f571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Thu, 11 Jan 2024 14:13:54 +0100 Subject: [PATCH] add a new example to handle dots --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index b76374d..f6e813e 100644 --- a/README.md +++ b/README.md @@ -851,6 +851,29 @@ $ niet . tests/samples/sample_not_indented.json } ``` +### Handle keys that contains dots + +You may want to retrieve values from keys that contains dots, example: + +```yaml +.foo: + something: "a" + +bar: + something: "b" + +foo.z: + something: "c" +``` + +Then you must surround keys that contains dots with quotes, example: + +``` +$ niet '".foo"' /tmp/test.yaml +something: a +$ niet '"foo.z"' /tmp/test.yaml +something: c +``` ## Tips