check number of arguments

This commit is contained in:
Jörg Thalheim 2022-11-25 09:50:03 +01:00
parent 985547acc6
commit efb8452b0f

View file

@ -23,7 +23,11 @@ def filter_interfaces(network):
return output 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: with open(sys.argv[1]) as f:
addresses = json.load(f) addresses = json.load(f)
with open(sys.argv[2]) as f: with open(sys.argv[2]) as f: