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="*")
tbs = subparsers.add_parser("tbs") hash = subparsers.add_parser("hash")
tbs.set_defaults(func=print_tbs) hash.set_defaults(func=print_hash)
tbs.add_argument("path", type=str) hash.add_argument("path", type=str)
args = parser.parse_args() args = parser.parse_args()
args.func(args) args.func(args)
def print_tbs(args) -> None: def print_hash(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()))