From 892308bf54991f487130e0e36050fe29b238b046 Mon Sep 17 00:00:00 2001 From: ryohma0510 Date: Tue, 18 Jul 2023 07:53:50 +0900 Subject: [PATCH] Improve comparing tips document (#1727) --- usage/tips-and-tricks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usage/tips-and-tricks.md b/usage/tips-and-tricks.md index 8051fe21..eaa146f4 100644 --- a/usage/tips-and-tricks.md +++ b/usage/tips-and-tricks.md @@ -148,7 +148,7 @@ yq -n '.someNew="content"' > newfile.yml The best way to run a diff is to use `yq` to normalise the yaml files and then just use diff. Here is a simple example of using pretty print `-P` to normalise the styling and running diff: ``` -diff <(yq -P 'sort_keys(..)' file1.yaml) <(yq -P 'sort_keys(..)' file2.yaml) +diff <(yq -P 'sort_keys(..)' -o=props file1.yaml) <(yq -P 'sort_keys(..)' -o=props file2.yaml) ``` This way you can use the full power of `diff` and normalise the yaml files as you like.