Skip to content

Commit 9302489

Browse files
committed
Actually pretty print the AST
1 parent b0c1004 commit 9302489

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/jp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
import json
55
import argparse
6+
from pprint import pformat
67

78
import jmespath
89
from jmespath import exceptions
@@ -22,7 +23,7 @@ def main():
2223
if args.ast:
2324
# Only print the AST
2425
expression = jmespath.compile(args.expression)
25-
sys.stdout.write(str(expression))
26+
sys.stdout.write(pformat(expression.parsed))
2627
sys.stdout.write('\n')
2728
return 0
2829
if args.filename:

0 commit comments

Comments
 (0)