Compare commits

..

2 commits

View file

@ -37,14 +37,14 @@ def main() -> None:
spot.add_argument("--domain", "-d", type=str, required=True) spot.add_argument("--domain", "-d", type=str, required=True)
spot.add_argument("--cache_file", "-c", type=str, required=True) spot.add_argument("--cache_file", "-c", type=str, required=True)
spot.add_argument("certs", type=str, nargs="*") spot.add_argument("certs", type=str, nargs="*")
hash = subparsers.add_parser("hash") tbs = subparsers.add_parser("tbs")
hash.set_defaults(func=print_hash) tbs.set_defaults(func=print_tbs)
hash.add_argument("path", type=str) tbs.add_argument("path", type=str)
args = parser.parse_args() args = parser.parse_args()
args.func(args) args.func(args)
def print_hash(args) -> None: def print_tbs(args) -> None:
with open(args.path, "rb") as f: with open(args.path, "rb") as f:
print(calc_tbs(f.read())) print(calc_tbs(f.read()))