Skip to content

Commit 1782493

Browse files
authored
Thread rate added
1 parent 3e8fdc6 commit 1782493

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

scope.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22
import sys
33

44
# Check if the file path is provided as a command-line argument
5-
if len(sys.argv) != 2:
6-
print("Usage: python3 scope.py <path_to_subdomain.txt>")
5+
if len(sys.argv) < 2:
6+
print("Usage: python3 scope.py <path_to_subdomain.txt> [thread_rate]")
77
sys.exit(1)
88

99
# Get the path to subdomain.txt from command-line arguments
1010
file_path = sys.argv[1]
1111

12+
# Get the thread rate if provided, else set default to 1
13+
thread_rate = int(sys.argv[2]) if len(sys.argv) > 2 else 1
14+
15+
# Validate the thread rate
16+
if not (1 <= thread_rate <= 100):
17+
print("Thread rate must be between 1 and 100.")
18+
sys.exit(1)
19+
1220
# Load subdomains from the specified file
1321
try:
1422
with open(file_path, "r") as file:

0 commit comments

Comments
 (0)