@@ -87,17 +87,29 @@ def cmd_parser_setup():
8787 action = "store_true" ,
8888 help = 'Parser friendly verbose mode' )
8989
90- parser .add_option ('' , '--json' ,
90+ parser .add_option ('-j ' , '--json' ,
9191 dest = 'json' ,
9292 default = False ,
9393 action = "store_true" ,
94- help = 'JSON formatted output ( list) ' )
94+ help = 'JSON formatted list of targets detailed information ' )
9595
96- parser .add_option ('' , '--json-by-target-id' ,
96+ parser .add_option ('-J ' , '--json-by-target-id' ,
9797 dest = 'json_by_target_id' ,
9898 default = False ,
9999 action = "store_true" ,
100- help = 'JSON formatted output where keys are TargetIDs (dict)' )
100+ help = 'JSON formatted dictionary ordered by TargetID of targets detailed information' )
101+
102+ parser .add_option ('-p' , '--json-platforms' ,
103+ dest = 'json_platforms' ,
104+ default = False ,
105+ action = "store_true" ,
106+ help = 'JSON formatted list of available platforms' )
107+
108+ parser .add_option ('-P' , '--json-platforms-ext' ,
109+ dest = 'json_platforms_ext' ,
110+ default = False ,
111+ action = "store_true" ,
112+ help = 'JSON formatted dictionary of platforms count' )
101113
102114 parser .add_option ('-d' , '--debug' ,
103115 dest = 'debug' ,
@@ -127,8 +139,16 @@ def mbedls_main():
127139
128140 if opts .json :
129141 print json .dumps (mbeds .list_mbeds_ext (), indent = 4 , sort_keys = True )
142+
130143 elif opts .json_by_target_id :
131144 print json .dumps (mbeds .list_mbeds_by_targetid (), indent = 4 , sort_keys = True )
145+
146+ elif opts .json_platforms :
147+ print json .dumps (mbeds .list_platforms (), indent = 4 , sort_keys = True )
148+
149+ elif opts .json_platforms_ext :
150+ print json .dumps (mbeds .list_platforms_ext (), indent = 4 , sort_keys = True )
151+
132152 else :
133153 print mbeds .get_string (border = not opts .simple , header = not opts .simple )
134154
0 commit comments