From e8e90d5ac872f27ce57d0f3451016f83949c1315 Mon Sep 17 00:00:00 2001 From: Michael Rasmussen Date: Wed, 5 Apr 2017 22:34:57 +0200 Subject: [PATCH] Add test for option record --- netconf | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/netconf b/netconf index 34443ff..25d3bff 100644 --- a/netconf +++ b/netconf @@ -183,11 +183,18 @@ def parse_input(): record = True else: assert False, 'Unhandled option' - - if not address or not interface: - print 'Error: missing options' - usage() - sys.exit(2) + + if (record): + if not (bool(address) ^ bool(interface)): + print 'Error: missing options' + usage() + sys.exit(2) + else: + if not address or not interface or error: + print 'Error: missing options' + usage() + sys.exit(2) + if address == '0': address = None if not netmask: -- 2.39.2