@@ -24,23 +24,25 @@ def main(filename: Path, pem: Path, verbose: Optional[bool]) -> None:
2424 if len (results ) == 0 :
2525 raise typer .BadParameter ("Signature missing" )
2626
27+ details : list [str ] = []
2728 for hash_ok , signature_ok , cert_ok in results :
2829 if not signature_ok :
29- print ( f "Signature ok: { signature_ok } " , file = sys . stderr )
30+ details . append ( "Signature not ok" )
3031 elif verbose :
31- print ( f "Signature ok: { signature_ok } " )
32+ details . append ( "Signature ok" )
3233 if not hash_ok :
33- print ( f "Content hash ok: { hash_ok } " , file = sys . stderr )
34+ details . append ( "Content hash not ok" )
3435 elif verbose :
35- print ( f "Content hash ok: { hash_ok } " )
36+ details . append ( "Content hash ok" )
3637 if not cert_ok :
37- print ( f "Certificate ok: { cert_ok } " , file = sys . stderr )
38+ details . append ( "Certificate not ok" )
3839 elif verbose :
39- print ( f "Certificate ok: { cert_ok } " )
40+ details . append ( "Certificate ok" )
4041
42+ details_str = "" if len (details ) == 0 else " (" + ", " .join (details ) + ")"
4143 for hash_ok , signature_ok , cert_ok in results :
4244 if not signature_ok or not hash_ok or not cert_ok :
43- print ("Failure " , file = sys .stderr )
45+ print (f"Check failed { details_str } . " , file = sys .stderr )
4446 raise typer .Exit (code = 1 )
4547
46- print ("Success " )
48+ print (f"Check succeeded { details_str } . " )
0 commit comments