Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dnsviz/dnsviz.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasey Deccio <casey@deccio.net>2020-12-08 21:46:47 +0300
committerCasey Deccio <casey@deccio.net>2020-12-08 21:46:47 +0300
commit879b28c480f2cebc5d1aa9ea25a2c27968f307c5 (patch)
tree260d160af39158bc324747699d02549d1c59cc4b
parent03f1efbcca0faad6a9c3268b1f48478b43748286 (diff)
Call print_help() on parsers
-rwxr-xr-xbin/dnsviz8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/dnsviz b/bin/dnsviz
index 02e5674..4fa4cb5 100755
--- a/bin/dnsviz
+++ b/bin/dnsviz
@@ -26,12 +26,15 @@ from __future__ import unicode_literals
import getopt
import importlib
+import logging
import os
import sys
CMD_DIR1 = 'dnsviz'
CMD_DIR2 = 'commands'
+logging.basicConfig(level=logging.WARNING, format='%(message)s')
+logger = logging.getLogger()
def check_deps():
# check dnspython dependency
@@ -65,7 +68,7 @@ def main():
try:
opts, args = getopt.getopt(sys.argv[1:], 'p:')
except getopt.GetoptError as e:
- sys.stderr.write('%s\n' % str(e))
+ usage(str(e) + '\n')
sys.exit(1)
opts = dict(opts)
@@ -124,7 +127,8 @@ def main():
sys.exit(1)
if args[0] == 'help':
- mod.usage()
+ helper = mod.build_helper(logger, sys.argv[0], command)
+ helper.parser.print_help()
else:
mod.main(args)