mirror of
https://github.com/codingo/Interlace.git
synced 2025-12-17 23:04:24 +01:00
Fixed the errors for ports and exclusions
This commit is contained in:
@@ -66,13 +66,14 @@ class InputHelper(object):
|
|||||||
final_commands = set()
|
final_commands = set()
|
||||||
output = OutputHelper(arguments)
|
output = OutputHelper(arguments)
|
||||||
|
|
||||||
if "," in arguments.port:
|
if arguments.port:
|
||||||
ports = arguments.port.split(",")
|
if "," in arguments.port:
|
||||||
elif "-" in arguments.port:
|
ports = arguments.port.split(",")
|
||||||
tmp_ports = arguments.port.split("-")
|
elif "-" in arguments.port:
|
||||||
ports = list(range(int(tmp_ports[0]), int(tmp_ports[1]) + 1))
|
tmp_ports = arguments.port.split("-")
|
||||||
else:
|
ports = list(range(int(tmp_ports[0]), int(tmp_ports[1]) + 1))
|
||||||
ports = [arguments.port]
|
else:
|
||||||
|
ports = [arguments.port]
|
||||||
|
|
||||||
|
|
||||||
# process targets first
|
# process targets first
|
||||||
@@ -86,8 +87,9 @@ class InputHelper(object):
|
|||||||
if arguments.exclusions:
|
if arguments.exclusions:
|
||||||
exclusions_ranges.add(arguments.exclusions)
|
exclusions_ranges.add(arguments.exclusions)
|
||||||
else:
|
else:
|
||||||
for exclusion in arguments.exclusions_list:
|
if arguments.exclusions_list:
|
||||||
exclusions_ranges.add(target.strip())
|
for exclusion in arguments.exclusions_list:
|
||||||
|
exclusions_ranges.add(target.strip())
|
||||||
|
|
||||||
# removing elements that may have spaces (helpful for easily processing comma notation)
|
# removing elements that may have spaces (helpful for easily processing comma notation)
|
||||||
for target in ranges:
|
for target in ranges:
|
||||||
|
|||||||
Reference in New Issue
Block a user