Permalink
Browse files

hide branches in brief mode

  • Loading branch information...
1 parent a22d669 commit bef2e4e3bef9ca66ef24ef034a376e274de6d743 @dominictarr committed Mar 13, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 JSON.sh
View
@@ -40,7 +40,7 @@ parse_array () {
done
;;
esac
- [ $BRIEF -ne 1 ] && value=`printf '[%s]' "$ary"`
+ [ $BRIEF -ne 1 ] && value=`printf '[%s]' "$ary"` || value=
}
parse_object () {
@@ -74,7 +74,7 @@ parse_object () {
done
;;
esac
- [ $BRIEF -ne 1 ] && value=`printf '{%s}' "$obj"`
+ [ $BRIEF -ne 1 ] && value=`printf '{%s}' "$obj"` || value=
}
parse_value () {
@@ -86,7 +86,7 @@ parse_value () {
''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;;
*) value=$token ;;
esac
- ! ([ $BRIEF -eq 1 ] && ([ -z $jpath ] || [ $value = '""' ])) \
+ ! ([ $BRIEF -eq 1 ] && ([ -z $jpath ] || [ "$value" = '' ])) \
&& printf "[%s]\t%s\n" "$jpath" "$value"
}

0 comments on commit bef2e4e

Please sign in to comment.