prettyprint/prettyprint |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 5e72499b6cdc3527db7e2facdc1903a2c7f6b4e5
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Fri May 7 09:08:44 2021 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri May 7 09:08:44 2021 +0200

    prettyprint: add json pretty-printer
    
    Useful when inspecting compile_commands.json in core.git e.g.
    
    Change-Id: I8eb3bd8184f53d3289720621f64d504216f4e916

diff --git a/prettyprint/prettyprint b/prettyprint/prettyprint
index b643d57..c36c957 100755
--- a/prettyprint/prettyprint
+++ b/prettyprint/prettyprint
@@ -12,6 +12,9 @@ if [ "$kind" == "text/rtf" ]; then
 elif [ "$kind" == "application/xml" -o "$kind" == "image/svg+xml" -o "$kind" 
== "text/xml" ]; then
        #xmllint --format --recover $file 2>/dev/null
        $mydir/formatxml $file
+elif [ "$1" == "json" ]; then
+       # file(1) sets $kind to text/plain for me, allow forcing it via a 
parameter
+       cat $file | python3 -mjson.tool
 else
        echo "unknown type: $kind"
 fi
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to