From f2e6f1a71cf7e8e71e9e5691d160a9f9dc8d77d7 Mon Sep 17 00:00:00 2001 From: Shaun Hammill Date: Wed, 5 Jun 2019 16:19:33 -0400 Subject: [PATCH] Replace getopt.getopt with getopt.gnu_getopt Addresses Issue #41, gnu_getopt allows non-option arguments to be intermingled with option arguments whereas getopt stops processing arguments when a non option is found. --- ssh-audit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssh-audit.py b/ssh-audit.py index 8b67387..b25a5e3 100755 --- a/ssh-audit.py +++ b/ssh-audit.py @@ -136,7 +136,7 @@ class AuditConf(object): sopts = 'h1246p:bnvl:' lopts = ['help', 'ssh1', 'ssh2', 'ipv4', 'ipv6', 'port', 'batch', 'no-colors', 'verbose', 'level='] - opts, args = getopt.getopt(args, sopts, lopts) + opts, args = getopt.gnu_getopt(args, sopts, lopts) except getopt.GetoptError as err: usage_cb(str(err)) aconf.ssh1, aconf.ssh2 = False, False