Threading base

This commit is contained in:
Michael Skelton
2018-10-23 22:16:57 +10:00
parent 1843319861
commit 60ac52c7e8
11 changed files with 70 additions and 751 deletions

View File

@@ -35,7 +35,7 @@ class InputHelper(object):
commands = set()
if arguments.command:
commands.add(arguments.target)
commands.add(arguments.command)
else:
for command in arguments.command_list:
commands.add(command.strip())
@@ -69,11 +69,19 @@ class InputParser(object):
parser.add_argument(
'-threads', dest='threads', required=False,
help="Specify the maximum number of threads to run (DEFAULT:5).",
help="Specify the maximum number of threads to run (DEFAULT:5)",
default=5,
type=lambda x: InputHelper.check_positive(parser, x)
)
parser.add_argument(
'-timeout', dest='timeout', required=False,
help="Command timeout in seconds (DEFAULT:600)",
default=600,
type=lambda x: InputHelper.check_positive(parser, x)
)
commands = parser.add_mutually_exclusive_group(required=True)
commands.add_argument(
'-c', dest='command',