Skip to content

Commit

Permalink
Actually pretty print the AST
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesls committed Jun 9, 2015
1 parent b0c1004 commit 9302489
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/jp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import json
import argparse
from pprint import pformat

import jmespath
from jmespath import exceptions
Expand All @@ -22,7 +23,7 @@ def main():
if args.ast:
# Only print the AST
expression = jmespath.compile(args.expression)
sys.stdout.write(str(expression))
sys.stdout.write(pformat(expression.parsed))
sys.stdout.write('\n')
return 0
if args.filename:
Expand Down

0 comments on commit 9302489

Please sign in to comment.