dnc

CLI tool to check domain names configuration and statistics
Log | Files | Refs | README | LICENSE

commit 1ab964d1eb1de44699ae2f419921b8caf43c9b17
parent 2644dea41e758fc15ffb05d2f8fc55ae75863dd9
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed, 24 Feb 2021 21:35:46 +0100

Formatting improvements in usage().

Diffstat:
Mdnc | 26+++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/dnc b/dnc @@ -18,6 +18,7 @@ import ssl import sys import OpenSSL import dns.resolver +import textwrap from datetime import datetime from prettytable import PrettyTable @@ -25,17 +26,20 @@ socket.setdefaulttimeout(1) def usage(): - print( - "dnc [-hv] domain\n\n" - "The options are as follows:\n\n" - " -4 Resolve and display A records (IPv4 addresses).\n" - " -6 Resolve and display AAAA records (IPv6 addresses).\n" - " -h Display usage.\n" - " -m Resolve and display MX records (Mail Exchange).\n" - " -n Resolve and display NS records (Name Servers).\n" - " -s Display SSL/TLS certificate expiration date.\n" - " -v Display version." - ) + usage = """\ + dnc [-hv] domain + + The options are as follows: + + -4 Resolve and display A records (IPv4 addresses). + -6 Resolve and display AAAA records (IPv6 addresses). + -h Display usage. + -m Resolve and display MX records (Mail Exchange). + -n Resolve and display NS records (Name Servers). + -s Display SSL/TLS certificate expiration date. + -v Display version.""" + + print(textwrap.dedent(usage)) def query(domain: str, rrtype: str) -> str: