From b703e6db06df06e6fd9825c0788f68f2fa50cc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20K=C3=A1cha?= <ph@cesnet.cz> Date: Thu, 19 May 2016 14:57:17 +0200 Subject: [PATCH] Argument parsing is now looser and silently ignores additional arguments (ADS may add surplus empty strings) --- flowmon-ads/warden3_flowmon_ads_filer.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flowmon-ads/warden3_flowmon_ads_filer.py b/flowmon-ads/warden3_flowmon_ads_filer.py index dc449be..6b5c7a0 100644 --- a/flowmon-ads/warden3_flowmon_ads_filer.py +++ b/flowmon-ads/warden3_flowmon_ads_filer.py @@ -38,11 +38,9 @@ def help(s=None, exitcode=0): def get_opts(): try: - rawopts, args = getopt.getopt(sys.argv[1:], "", getopt_format) + rawopts, args = getopt.gnu_getopt(sys.argv[1:], "", getopt_format) except getopt.GetoptError as err: help(err, exitcode=2) - if args: - help("unknown arg %s" % ", ".join(args), exitcode=2) rawopts = dict(rawopts) if "--help" in rawopts: help() -- GitLab