@@ -247,6 +247,15 @@ def action_check_list(rpc):
247
247
check ['patch' ]))
248
248
249
249
250
+ def action_check_info (rpc , check_id ):
251
+ check = rpc .check_get (check_id )
252
+ s = "Information for check id %d" % (check_id )
253
+ print (s )
254
+ print ('-' * len (s ))
255
+ for key , value in sorted (check .items ()):
256
+ print ("- %- 14s: %s" % (key , unicode (value ).encode ("utf-8" )))
257
+
258
+
250
259
def action_check_create (rpc , patch_id , context , state , url , description ):
251
260
try :
252
261
rpc .check_create (patch_id , context , state , url , description )
@@ -485,6 +494,15 @@ def main():
485
494
help = '''List all checks'''
486
495
)
487
496
check_list_parser .set_defaults (subcmd = 'check_list' )
497
+ check_info_parser = subparsers .add_parser (
498
+ 'check-info' ,
499
+ add_help = False ,
500
+ help = '''Show information for a given check'''
501
+ )
502
+ check_info_parser .set_defaults (subcmd = 'check_info' )
503
+ check_info_parser .add_argument (
504
+ 'check_id' , metavar = 'ID' , action = 'store' , type = int ,
505
+ help = 'Check ID' ,)
488
506
check_create_parser = subparsers .add_parser (
489
507
'check-create' , parents = [hash_parser ], conflict_handler = 'resolve' ,
490
508
help = 'Add a check to a patch' )
@@ -772,6 +790,10 @@ def main():
772
790
elif action == 'check_list' :
773
791
action_check_list (rpc )
774
792
793
+ elif action == 'check_info' :
794
+ check_id = args ['check_id' ]
795
+ action_check_info (rpc , check_id )
796
+
775
797
elif action == 'check_create' :
776
798
for patch_id in non_empty (h , patch_ids ):
777
799
action_check_create (
0 commit comments