From 7063138e3c30759cd57464c79b2e035db504c815 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Tue, 4 Jun 2019 09:39:33 -0400 Subject: [PATCH] small improvements from our cli investigation --- lbrynet/conf.py | 2 +- lbrynet/extras/cli.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lbrynet/conf.py b/lbrynet/conf.py index ef1a49533..11c2d50e9 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -121,7 +121,7 @@ class Toggle(Setting[bool]): ) parser.add_argument( self.no_cli_name, - help=f"Opposite of --{self.cli_name}", + help=f"Opposite of {self.cli_name}", dest=self.name, action="store_false", default=NOT_SET diff --git a/lbrynet/extras/cli.py b/lbrynet/extras/cli.py index 02834f66f..a6e0623eb 100644 --- a/lbrynet/extras/cli.py +++ b/lbrynet/extras/cli.py @@ -169,7 +169,7 @@ def add_command_parser(parent, command): def get_argument_parser(): main = ArgumentParser( - 'lbrynet', description='An interface to the LBRY Network.' + 'lbrynet', description='An interface to the LBRY Network.', allow_abbrev=False, ) main.add_argument( '-v', '--version', dest='cli_version', action="store_true", @@ -192,8 +192,8 @@ def get_argument_parser(): help=('Enable debug output. Optionally specify loggers for which debug output ' 'should selectively be applied.') ) - start.set_defaults(command='start', start_parser=start) Config.contribute_to_argparse(start) + start.set_defaults(command='start', start_parser=start, doc=start.format_help()) api = Daemon.get_api_definitions() groups = {} @@ -239,6 +239,7 @@ def main(argv=None): if args.help: args.start_parser.print_help() return 0 + default_formatter = logging.Formatter("%(asctime)s %(levelname)-8s %(name)s:%(lineno)d: %(message)s") file_handler = logging.handlers.RotatingFileHandler( conf.log_file_path, maxBytes=2097152, backupCount=5 @@ -264,6 +265,7 @@ def main(argv=None): loop.set_debug(True) else: log.setLevel(logging.INFO) + if conf.share_usage_data: loggly_handler = get_loggly_handler() loggly_handler.setLevel(logging.ERROR)