From 7ae4c613ac2cfa96a1bfd5456d543dbaded3cc52 Mon Sep 17 00:00:00 2001 From: Babak Farrokhi Date: Mon, 25 Apr 2016 11:25:18 +0430 Subject: [PATCH] trivial "pythonic" fixes --- dnseval.py | 16 +++++++++------- dnsping.py | 2 +- dnstraceroute.py | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dnseval.py b/dnseval.py index 59e72ab..54f3f47 100755 --- a/dnseval.py +++ b/dnseval.py @@ -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() diff --git a/dnsping.py b/dnsping.py index 6b530ca..7aed16f 100755 --- a/dnsping.py +++ b/dnsping.py @@ -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 diff --git a/dnstraceroute.py b/dnstraceroute.py index 6e83776..b0bd084 100755 --- a/dnstraceroute.py +++ b/dnstraceroute.py @@ -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')