minore code cleanup
This commit is contained in:
parent
e155625401
commit
fdc300eb8d
@ -72,7 +72,6 @@ def main():
|
|||||||
# print help information and exit:
|
# print help information and exit:
|
||||||
print(err) # will print something like "option -a not recognized"
|
print(err) # will print something like "option -a not recognized"
|
||||||
usage()
|
usage()
|
||||||
exit(2)
|
|
||||||
|
|
||||||
if args and len(args) == 1:
|
if args and len(args) == 1:
|
||||||
hostname = args[0]
|
hostname = args[0]
|
||||||
@ -96,11 +95,7 @@ def main():
|
|||||||
elif o in ("-t", "--type"):
|
elif o in ("-t", "--type"):
|
||||||
dnsrecord = a
|
dnsrecord = a
|
||||||
else:
|
else:
|
||||||
if a.startswith('-'):
|
usage()
|
||||||
print("unknown syntax: %s" % a)
|
|
||||||
usage()
|
|
||||||
else:
|
|
||||||
hostname = a
|
|
||||||
|
|
||||||
resolver = dns.resolver.Resolver()
|
resolver = dns.resolver.Resolver()
|
||||||
resolver.nameservers=[dnsserver]
|
resolver.nameservers=[dnsserver]
|
||||||
@ -161,3 +156,4 @@ def main():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user