Permalink
Browse files

Better `json` function

Ref. 9b0af44
  • Loading branch information...
1 parent f62dfea commit 307c4257f2b627de8bb5e829c3ab9b1a4039c7f1 @mathiasbynens committed Jan 2, 2012
Showing with 1 addition and 3 deletions.
  1. 0 .bash_profile
  2. +1 −3 .functions
View
0 .bash_profile 100755 → 100644
No changes.
View
@@ -21,9 +21,7 @@ function httpcompression() {
function json() {
if [ -p /dev/stdin ]; then
# piping, e.g. `echo '{"foo":42}' | json`
- while read data; do
- python -mjson.tool <<< "$data" | pygmentize -l javascript
- done
+ python -mjson.tool | pygmentize -l javascript
else
# e.g. `json '{"foo":42}'`
python -mjson.tool <<< "$*" | pygmentize -l javascript

0 comments on commit 307c425

Please sign in to comment.