Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fully fix brief mode.

  • Loading branch information...
commit 6377f63a666992c80fdf1dead2473fb9348d8f45 1 parent 6a6fafd
@mclarkson mclarkson authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 JSON.sh
View
8 JSON.sh
@@ -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"
:
}
Please sign in to comment.
Something went wrong with that request. Please try again.