From f5510f9777bb05babbc60e625ae721e003dfd59c Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 24 Sep 2021 20:05:24 +0200 Subject: [PATCH] Added verbosity options to rnsd --- RNS/Utilities/rnsd.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/RNS/Utilities/rnsd.py b/RNS/Utilities/rnsd.py index 8310b79..383b56b 100644 --- a/RNS/Utilities/rnsd.py +++ b/RNS/Utilities/rnsd.py @@ -6,9 +6,9 @@ import argparse from RNS._version import __version__ -def program_setup(configdir): - reticulum = RNS.Reticulum(configdir = configdir) - RNS.log("Started rnsd version {version}".format(version=__version__), RNS.LOG_INFO) +def program_setup(configdir, verbosity = 0, quietness = 0): + reticulum = RNS.Reticulum(configdir = configdir, loglevel = 3+verbosity-quietness) + RNS.log("Started rnsd version {version}".format(version=__version__), RNS.LOG_NOTICE) while True: input() @@ -16,6 +16,8 @@ def main(): try: parser = argparse.ArgumentParser(description="Reticulum Network Stack Daemon") parser.add_argument("--config", action="store", default=None, help="path to alternative Reticulum config directory", type=str) + parser.add_argument('-v', '--verbose', action='count', default=0) + parser.add_argument('-q', '--quiet', action='count', default=0) parser.add_argument("--version", action="version", version="rnsd {version}".format(version=__version__)) args = parser.parse_args() @@ -25,7 +27,7 @@ def main(): else: configarg = None - program_setup(configdir = configarg) + program_setup(configdir = configarg, verbosity=args.verbose, quietness=args.quiet) except KeyboardInterrupt: print("")