File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import jmespath
8
8
from jmespath import exceptions
9
- from jmespath .compat import OrderedDict
10
9
11
10
12
11
def main ():
13
12
parser = argparse .ArgumentParser ()
14
13
parser .add_argument ('expression' )
15
- parser .add_argument ('-o' , '--ordered' , action = 'store_true' ,
16
- help = 'Preserve the order of hash keys, which '
17
- 'are normally unordered.' )
18
14
parser .add_argument ('-f' , '--filename' ,
19
15
help = ('The filename containing the input data. '
20
16
'If a filename is not given then data is '
@@ -34,10 +30,7 @@ def main():
34
30
data = json .load (f )
35
31
else :
36
32
data = sys .stdin .read ()
37
- if args .ordered :
38
- data = json .loads (data , object_pairs_hook = OrderedDict )
39
- else :
40
- data = json .loads (data )
33
+ data = json .loads (data )
41
34
try :
42
35
sys .stdout .write (json .dumps (
43
36
jmespath .search (expression , data ), indent = 4 ))
You can’t perform that action at this time.
0 commit comments