dnc

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

commit 079cb073f65cbc13d65724026ecc5f25aaf52a40
parent bbbc652561510d717b9586ec090cdbdf1d2ab6d8
Author: Frederic Cambus <fred@statdns.com>
Date:   Sun, 17 Jan 2021 20:19:11 +0100

Use more meaningful variable names everywhere.

Diffstat:
Mdnc.py | 20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/dnc.py b/dnc.py @@ -6,7 +6,7 @@ # https://github.com/fcambus/dnc # # Created: 2014-02-11 -# Last Updated: 2021-01-04 +# Last Updated: 2021-01-17 # # dnc is released under the BSD 2-Clause license. # See LICENSE file for details. @@ -29,26 +29,26 @@ def query(domain, rrtype): def main(): getv6 = False - x = PrettyTable(hrules=1) + results = PrettyTable(hrules=1) try: - opts, args = getopt.getopt(sys.argv[1:], "6v") + options, args = getopt.getopt(sys.argv[1:], "6v") except getopt.GetoptError as err: print(err) sys.exit(1) header = ["Domain", "NS", "IPv4"] - for o, a in opts: - if o == "-6": + for option, arg in options: + if option == "-6": header.append("IPv6") getv6 = True - elif o == "-v": + elif option == "-v": print("dnc 0.2.0") sys.exit(0) - x.field_names = header - x.align = "l" + results.field_names = header + results.align = "l" for name in args: row = [name, query(name, 'NS'), query(name, 'A')] @@ -56,9 +56,9 @@ def main(): if getv6: row.append(query(name, 'AAAA')) - x.add_row(row) + results.add_row(row) - print(x) + print(results) if __name__ == "__main__":