From: Michael Rasmussen Date: Wed, 5 Apr 2017 20:34:57 +0000 (+0200) Subject: Add test for option record X-Git-Url: http://git.datanom.net/netconf.git/commitdiff_plain/e8e90d5ac872f27ce57d0f3451016f83949c1315 Add test for option record --- 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: