Skip to content
Browse files

Get the full speed enhancement with '-b', brief.

  • Loading branch information...
1 parent 14dc5ce commit 72a71ad5e472aa6b966d4de7c817319ce717857f @mclarkson mclarkson committed Mar 25, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 JSON.sh
View
8 JSON.sh
@@ -5,6 +5,7 @@ throw () {
exit 1
}
+BRIEF=0
LEAFONLY=0
PRUNEMPTY=0
@@ -26,7 +27,8 @@ parse_options() {
-h) usage
exit 0
;;
- -b) LEAFONLY=1
+ -b) BRIEF=1
+ LEAFONLY=1
PRUNEMPTY=1
;;
-l) LEAFONLY=1
@@ -78,7 +80,7 @@ parse_array () {
done
;;
esac
- value=`printf '[%s]' "$ary"` || value=
+ [ "$BRIEF" -eq 0 ] && value=`printf '[%s]' "$ary"` || value=
:
}
@@ -113,7 +115,7 @@ parse_object () {
done
;;
esac
- value=`printf '{%s}' "$obj"` || value=
+ [ "$BRIEF" -eq 0 ] && value=`printf '{%s}' "$obj"` || value=
:
}

0 comments on commit 72a71ad

Please sign in to comment.
Something went wrong with that request. Please try again.