From efb8452b0f9f041caff70371ccb42ca6d7a09c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 25 Nov 2022 09:50:03 +0100 Subject: [PATCH] check number of arguments --- nix/restore_routes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nix/restore_routes.py b/nix/restore_routes.py index 7ca4969..6fabc89 100644 --- a/nix/restore_routes.py +++ b/nix/restore_routes.py @@ -23,7 +23,11 @@ def filter_interfaces(network): return output -def main(): +def main() -> None: + if len(sys.argv) < 3: + print(f"USAGE: {sys.argv[0]} addresses routes", file=sys.stderr) + sys.exit(1) + with open(sys.argv[1]) as f: addresses = json.load(f) with open(sys.argv[2]) as f: