trivial "pythonic" fixes

This commit is contained in:
Babak Farrokhi 2016-04-25 11:25:18 +04:30
parent 98e0a8199f
commit 7ae4c613ac
Signed by: farrokhi
GPG Key ID: 6B267AD85D632E9A
3 changed files with 11 additions and 9 deletions

View File

@ -43,13 +43,15 @@ resolvers = dns.resolver.get_default_resolver().nameservers
def usage():
print('%s version %1.1f\n' % (__PROGNAME__, __VERSION__))
print('syntax: %s [-h] [-f server-list] [-c count] [-t type] [-w wait] hostname' % __PROGNAME__)
print(' -h --help show this help')
print(' -f --file dns server list to use (default: system resolvers)')
print(' -c --count number of requests to send (default: 10)')
print(' -w --wait maximum wait time for a reply (default: 5)')
print(' -t --type DNS request record type (default: A)')
print("""%s version %1.1f
usage: %s [-h] [-f server-list] [-c count] [-t type] [-w wait] hostname
-h --help show this help
-f --file dns server list to use (default: system resolvers)
-c --count number of requests to send (default: 10)
-w --wait maximum wait time for a reply (default: 5)
-t --type DNS request record type (default: A)
""" % (__PROGNAME__, __VERSION__, __PROGNAME__))
exit()

View File

@ -44,7 +44,7 @@ should_stop = False
def usage():
print("""%s version %1.1f
syntax: %s [-h] [-q] [-v] [-s server] [-p port] [-P port] [-S address] [-c count] [-t type] [-w wait] hostname
usage: %s [-h] [-q] [-v] [-s server] [-p port] [-P port] [-S address] [-c count] [-t type] [-w wait] hostname
-h --help Show this help
-q --quiet Quiet
-v --verbose Print actual dns response

View File

@ -85,7 +85,7 @@ if has_whois:
def usage():
print('%s version %1.1f\n' % (__PROGNAME__, __VERSION__))
print('syntax: %s [-h] [-q] [-a] [-s server] [-p port] [-c count] [-t type] [-w wait] hostname' % __PROGNAME__)
print('usage: %s [-h] [-q] [-a] [-s server] [-p port] [-c count] [-t type] [-w wait] hostname' % __PROGNAME__)
print(' -h --help Show this help')
print(' -q --quiet Quiet')
print(' -a --asn Turn on AS# lookups for each hop encountered')