You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this feature will make user to use the script from command line
with some arguments that specified by the user.
with this aproach there is no need to prompt user for any input. script will
use the config.ini if user does not pass any args, or user can choose
other path for config.ini or pass each args with coresponding switch.
if any switch does not pass to the script, script will use the default
value in define in the script it self.
parser.add_argument("--custom-config", type=str, help="Path to the custom config file")
46
+
parser.add_argument("--max-ip", type=int, help=f"Specify max IP [{DEFAULT_MAX_IP}]: ", default=DEFAULT_MAX_IP)
47
+
parser.add_argument("--max-ping", type=int, help=f"Specify max Ping [{DEFAULT_MAX_PING}]: ", default=DEFAULT_MAX_PING)
48
+
parser.add_argument("--max-jitter", type=int, help=f"Specify max Jitter [{DEFAULT_MAX_JITTER}]: ", default=DEFAULT_MAX_JITTER)
49
+
parser.add_argument("--max-latency", type=int, help=f"Specify max Latency [{DEFAULT_MAX_LATENCY}]: ", default=DEFAULT_MAX_LATENCY)
50
+
parser.add_argument("--ip-include", type=str, help=f"Specify IPs to include (comma seperated, '-' to ignore) [{DEFAULT_IP_INCLUDE}]: ", default=DEFAULT_IP_INCLUDE)
51
+
parser.add_argument("--ip-exclude", type=str, help=f"Specify IPs to exclude (comma seperated, '-' to ignore) [{DEFAULT_IP_EXCLUDE}]: ", default=DEFAULT_IP_EXCLUDE)
52
+
parser.add_argument("--test-size", type=int, help=f"Specify test data size in KB [{DEFAULT_DOWNLOAD_SIZE_KB}]: ", default=DEFAULT_DOWNLOAD_SIZE_KB)
parser.add_argument("--cf-zone-id", type=str, help=f"Specify CloudFlare zone ID")
57
+
parser.add_argument("--cf-api-key", type=str, help=f"Specify CloudFlare API key")
58
+
parser.add_argument("--cf-sub-domain", type=str, help=f"Specify you active sub domain in CloudFlare")
59
+
parser.add_argument("--cf-delete-extisting-record", action="store_true", default=False, help="delete extisting records of given subdomain before uploading the result to your Cloudflare(yes/no)(defaults to no)")
60
+
args=parser.parse_args()
61
+
45
62
# Create a new configparser instance and load the configuration file
# Clear the include regex in case "-" provided by the user
97
111
ifip_include=='-':
@@ -111,18 +125,13 @@ def main():
111
125
min_upload_speed=float(min_upload_speed)
112
126
113
127
114
-
# Prompt the user for whether they want to upload the result to their Cloudflare subdomain
115
-
upload_results=input(f"Do you want to upload the result to your Cloudflare subdomain (yes/no) [{upload_results}]? ") orupload_results
116
-
117
128
# Code block to execute if upload_results is 'y' or 'yes'
118
-
ifupload_results.lower() in ["y", "yes"]:
119
-
delete_existing=input(f"Do you want to delete extisting records of given subdomain before uploading the result to your Cloudflare (yes/no) [{delete_existing}]? ") ordelete_existing
0 commit comments