Permalink
Browse files

Fully fix brief mode.

  • Loading branch information...
1 parent 6a6fafd commit 6377f63a666992c80fdf1dead2473fb9348d8f45 @mclarkson mclarkson committed Mar 22, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 JSON.sh
View
@@ -89,10 +89,12 @@ parse_value () {
'[') parse_array "$jpath" ;;
# At this point, the only valid single-character tokens are digits.
''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;;
- *) value=$token ;;
+ *) value=$token
+ [ $BRIEF -eq 1 ] && \
+ [ "$value" != '""' ] && printf "[%s]\t%s\n" "$jpath" "$value"
+ ;;
esac
- ! ([ $BRIEF -eq 1 ] && ([ -z "$jpath" ] || [ "$value" = '' ])) \
- && printf "[%s]\t%s\n" "$jpath" "$value"
+ [ $BRIEF -eq 0 ] && printf "[%s]\t%s\n" "$jpath" "$value"
:
}

0 comments on commit 6377f63

Please sign in to comment.