mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-08-16 17:51:27 +02:00
feat(jsontools): add tools to pretty print json-lines (ndjson) (#10176)
Co-authored-by: Marc Cornellà <hello@mcornella.com>
This commit is contained in:
committed by
Marc Cornellà
parent
b590939637
commit
7ded6752fd
@ -101,5 +101,13 @@ print(unquote_plus(sys.stdin.read()))
|
||||
}
|
||||
;;
|
||||
esac
|
||||
|
||||
unset JSONTOOLS_METHOD
|
||||
|
||||
## Add NDJSON support
|
||||
|
||||
function {pp,is,urlencode,urldecode}_ndjson() {
|
||||
local json jsonfunc="${0//ndjson/json}"
|
||||
while read -r json; do
|
||||
$jsonfunc <<< "$json"
|
||||
done
|
||||
}
|
||||
|
Reference in New Issue
Block a user