aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2019-12-25 17:25:49 -0500
committerRob Austein <sra@hactrn.net>2019-12-25 17:25:49 -0500
commitedc47afc341bacaf5540791ed2cc7e5c5f72d699 (patch)
tree9773a11812e839deb7f338d79939a5c16395b928
parent851f2b128f59f568cf82acb56ad26192da2db7d3 (diff)
More help
-rw-r--r--README.md28
-rwxr-xr-x[-rw-r--r--]tsig-keygen.py4
2 files changed, 30 insertions, 2 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d38b7e8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,28 @@
+tsig-keygen.py
+==============
+
+```
+usage: tsig-keygen.py [-h] [-a {hmac-sha256,hmac-sha384,hmac-sha512}]
+ [-d DIRECTORY] [-f {bind9,nsd}] [-k KEY] [-n NAME]
+ [-o OUTPUT] [-s SERVERS [SERVERS ...]]
+ [-z ZONES [ZONES ...]]
+
+Pure Python TSIG key generator with multiple output formats.
+
+optional arguments:
+ -h, --help show this help message and exit
+ -a {hmac-sha256,hmac-sha384,hmac-sha512}, --algorithm {hmac-sha256,hmac-sha384,hmac-sha512}
+ TSIG algorithm
+ -d DIRECTORY, --directory DIRECTORY
+ where to store secondary zone files
+ -f {bind9,nsd}, --format {bind9,nsd}
+ output format (default: nsd
+ -k KEY, --key KEY TSIG shared secret (default: generate new secret)
+ -n NAME, --name NAME DNS name for TSIG shared secret
+ -o OUTPUT, --output OUTPUT
+ output file
+ -s SERVERS [SERVERS ...], --servers SERVERS [SERVERS ...]
+ address(es) of primary nameserver(s)
+ -z ZONES [ZONES ...], --zones ZONES [ZONES ...]
+ zone(s) to xfr from specified nameserver(s)
+```
diff --git a/tsig-keygen.py b/tsig-keygen.py
index 4dfc192..2241759 100644..100755
--- a/tsig-keygen.py
+++ b/tsig-keygen.py
@@ -55,9 +55,9 @@ zone:
''')
ap = argparse.ArgumentParser(description = __doc__)
-ap.add_argument("-a", "--algorithm", choices = algorithm_choices, default = algorithm_choices[0])
+ap.add_argument("-a", "--algorithm", choices = algorithm_choices, default = algorithm_choices[0], help = "TSIG algorithm")
ap.add_argument("-d", "--directory", default = "secondary", help = "where to store secondary zone files")
-ap.add_argument("-f", "--format", choices = tuple(templates), default = "nsd")
+ap.add_argument("-f", "--format", choices = tuple(templates), default = "nsd", help = "output format (default: nsd")
ap.add_argument("-k", "--key", help = "TSIG shared secret (default: generate new secret)")
ap.add_argument("-n", "--name", default = "tsig.example.org", help = "DNS name for TSIG shared secret")
ap.add_argument("-o", "--output", default = "-", type = argparse.FileType("w"), help = "output file")