Set diff. helpstrings for -1 option for list-exchanges and list-timeframes

This commit is contained in:
hroff-1902 2019-10-09 03:37:54 +03:00
parent caf415dc97
commit 1a625f0bdd
3 changed files with 11 additions and 5 deletions

View File

@ -29,9 +29,9 @@ ARGS_HYPEROPT = ARGS_COMMON_OPTIMIZE + ["hyperopt", "hyperopt_path",
ARGS_EDGE = ARGS_COMMON_OPTIMIZE + ["stoploss_range"] ARGS_EDGE = ARGS_COMMON_OPTIMIZE + ["stoploss_range"]
ARGS_LIST_EXCHANGES = ["print_one_column", "list_exchanges_all"] ARGS_LIST_EXCHANGES = ["list_exchanges_all", "list_exchanges_print_one_column"]
ARGS_LIST_TIMEFRAMES = ["exchange", "print_one_column"] ARGS_LIST_TIMEFRAMES = ["exchange", "list_timeframes_print_one_column"]
ARGS_CREATE_USERDIR = ["user_data_dir"] ARGS_CREATE_USERDIR = ["user_data_dir"]

View File

@ -245,7 +245,7 @@ AVAILABLE_CLI_OPTIONS = {
default=constants.DEFAULT_HYPEROPT_LOSS, default=constants.DEFAULT_HYPEROPT_LOSS,
), ),
# List exchanges # List exchanges
"print_one_column": Arg( "list_exchanges_print_one_column": Arg(
'-1', '--one-column', '-1', '--one-column',
help='Print exchanges in one column.', help='Print exchanges in one column.',
action='store_true', action='store_true',
@ -255,6 +255,12 @@ AVAILABLE_CLI_OPTIONS = {
help='Print all exchanges known to the ccxt library.', help='Print all exchanges known to the ccxt library.',
action='store_true', action='store_true',
), ),
# List timeframes
"list_timeframes_print_one_column": Arg(
'-1', '--one-column',
help='Print timeframes in one column.',
action='store_true',
),
# Script options # Script options
"pairs": Arg( "pairs": Arg(
'-p', '--pairs', '-p', '--pairs',

View File

@ -40,7 +40,7 @@ def start_list_exchanges(args: Dict[str, Any]) -> None:
:return: None :return: None
""" """
exchanges = ccxt_exchanges() if args['list_exchanges_all'] else available_exchanges() exchanges = ccxt_exchanges() if args['list_exchanges_all'] else available_exchanges()
if args['print_one_column']: if args['list_exchanges_print_one_column']:
print('\n'.join(exchanges)) print('\n'.join(exchanges))
else: else:
if args['list_exchanges_all']: if args['list_exchanges_all']:
@ -112,7 +112,7 @@ def start_list_timeframes(args: Dict[str, Any]) -> None:
# Init exchange # Init exchange
exchange = ExchangeResolver(config['exchange']['name'], config).exchange exchange = ExchangeResolver(config['exchange']['name'], config).exchange
if args['print_one_column']: if args['list_timeframes_print_one_column']:
print('\n'.join(exchange.timeframes)) print('\n'.join(exchange.timeframes))
else: else:
print(f"Timeframes available for the exchange `{config['exchange']['name']}`: " print(f"Timeframes available for the exchange `{config['exchange']['name']}`: "