Permalink
Browse files

cjson now supports local files

  • Loading branch information...
1 parent 4f8b0c7 commit 6e174e9371db728713373fe8061decad1270ec4a @gf3 committed Apr 17, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 .functions
View
@@ -20,6 +20,11 @@ cp_p () {
# Pretty print JSON
cjson () {
- curl --silent $1 | python -mjson.tool | pygmentize -O style=monokai -f console256 -g
+ local url=$(echo $1)
+ if [[ "http" == $url[0,4] ]] ; then
+ curl --silent $url | python -mjson.tool | pygmentize -O style=monokai -f console256 -g
+ else
+ cat $url | python -mjson.tool | pygmentize -O style=monokai -f console256 -g
+ fi
}

0 comments on commit 6e174e9

Please sign in to comment.