I squeezed in some time to improve my script:
* Added a --check option to check cert files for problems and report them:
- certificates following a self-signed cert
- certificates not signed by the subsequent cert
- identify self-signed certs
* It's now usable in a pipeline:
- If no file arguments are given then it reads from stdin
- Any file argument of - read stdin when that argument is processed
- All non-certificate lines in the input are ignored so you can pipe the
output of openssl s_client to it without needing to pre-process the data
* To make it easier to use it from another script, it now exits with a meaningful exit status:
- 0 No problems were detected.
- 1 Some files were not readable.
- 2 Problems were found within at least one certificate file.
- 3 Invalid parameters were given, or help was requested.
* I expanded and improved the help text
* I renamed the -d | --details option to -s | --some to make the order of increasing detail more obvious
- the --all, --most, --some, and --summary options are ordered by the amount of detailed info they provide, from most to least.
- this conflicted with the -s | --summary option so I renamed that to -S | --summary