diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-05-23 15:48:06 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-05-23 15:48:06 -0300 |
commit | db1b5e010dfcb120b0e7f685ccefbcb311ed230e (patch) | |
tree | 9bb00b0b5dba2500ecdc9ee3a2b097babbfb5273 | |
parent | 08940e38cb120c39330060c2bd146b00b72a1c9b (diff) | |
download | profile-db1b5e010dfcb120b0e7f685ccefbcb311ed230e.tar.gz profile-db1b5e010dfcb120b0e7f685ccefbcb311ed230e.tar.bz2 |
Pretty printing aliases for JSON
-rw-r--r-- | aliases.dot.link | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/aliases.dot.link b/aliases.dot.link index 54717a7..d660066 100644 --- a/aliases.dot.link +++ b/aliases.dot.link @@ -59,3 +59,17 @@ alias s="shell" alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg" alias dpkg-source='HOME=~/code/debian/keyring dpkg-source' alias dget='HOME=~/code/debian/keyring dget' + +# JSON +# See https://stackoverflow.com/questions/352098/how-can-i-pretty-print-json-in-a-shell-script#1920585 +prettyjson_string() { + echo "$1" | python -m json.tool +} + +prettyjson_file() { + python -m json.tool "$1" +} + +prettyjson_url() { + curl "$1" | python -m json.tool +} |