From d0526ad7d5c2088720e412ac3acccc1adbae044c Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Thu, 24 Jan 2019 19:16:39 -0500 Subject: [PATCH] bring --config back to start command --- lbrynet/conf.py | 14 +++++++++----- lbrynet/extras/cli.py | 6 +++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lbrynet/conf.py b/lbrynet/conf.py index 3f859b396..402c762da 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -269,7 +269,7 @@ class ConfigFileAccess: class BaseConfig: - config = Path("Path to configuration file.") + config = Path("Path to configuration file.", metavar='FILE') def __init__(self, **kwargs): self.runtime = {} # set internally or by various API calls @@ -307,7 +307,8 @@ class BaseConfig: @classmethod def get_settings(cls): - for setting in cls.__dict__.values(): + for attr in dir(cls): + setting = getattr(cls, attr) if isinstance(setting, Setting): yield setting @@ -387,11 +388,14 @@ class CLIConfig(BaseConfig): class Config(CLIConfig): - data_dir = Path("Directory path to store blobs.") - download_dir = Path("Directory path to place assembled files downloaded from LBRY.") + data_dir = Path("Directory path to store blobs.", metavar='DIR') + download_dir = Path( + "Directory path to place assembled files downloaded from LBRY.", + previous_names=['download_directory'], metavar='DIR' + ) wallet_dir = Path( "Directory containing a 'wallets' subdirectory with 'default_wallet' file.", - previous_names=['lbryum_wallet_dir'] + previous_names=['lbryum_wallet_dir'], metavar='DIR' ) share_usage_data = Toggle( diff --git a/lbrynet/extras/cli.py b/lbrynet/extras/cli.py index 5e2dfeffa..a8ed2255b 100644 --- a/lbrynet/extras/cli.py +++ b/lbrynet/extras/cli.py @@ -172,7 +172,11 @@ def get_argument_parser(): main.set_defaults(group=None, command=None) CLIConfig.contribute_args(main) sub = main.add_subparsers(metavar='COMMAND') - start = sub.add_parser('start', usage='lbrynet start [OPTIONS]', help='Start lbrynet API server.') + start = sub.add_parser( + 'start', + usage='lbrynet start [--config FILE] [--data-dir DIR] [--wallet-dir DIR] [--download-dir DIR] ...', + help='Start lbrynet API server.' + ) start.add_argument( '--quiet', dest='quiet', action="store_true", help='Disable all console output.'