Skip to content
This repository was archived by the owner on Feb 3, 2024. It is now read-only.

Commit baade89

Browse files
committed
add printing all tld to test2.py
1 parent b0d955d commit baade89

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test2.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,9 @@ def main(argv):
226226
try:
227227
opts, args = getopt.getopt(
228228
argv,
229-
"pvIhaf:d:D:r:H:",
229+
"SpvIhaf:d:D:r:H:",
230230
[
231+
"SupportedTld",
231232
"print",
232233
"verbose",
233234
"IgnoreReturncode",
@@ -259,9 +260,14 @@ def main(argv):
259260
fileData = {}
260261

261262
for opt, arg in opts:
263+
if opt in ( "-S", "SupportedTld"):
264+
for tld in sorted(whois.validTlds()):
265+
print(tld)
266+
sys.exit(0)
267+
262268
if opt == "-h":
263269
usage()
264-
sys.exit()
270+
sys.exit(0)
265271

266272
if opt in ("-a", "--all"):
267273
testAllTld = True

0 commit comments

Comments
 (0)