diff --git a/freqtrade/commands/arguments.py b/freqtrade/commands/arguments.py index d6b326050..3ccb854b3 100755 --- a/freqtrade/commands/arguments.py +++ b/freqtrade/commands/arguments.py @@ -3,6 +3,7 @@ This module contains the argument manager class """ from argparse import ArgumentParser, Namespace, _ArgumentGroup +from copy import deepcopy from functools import partial from pathlib import Path from typing import Any @@ -349,7 +350,11 @@ class Arguments: def _build_args(self, optionlist: list[str], parser: ArgumentParser | _ArgumentGroup) -> None: for val in optionlist: opt = AVAILABLE_CLI_OPTIONS[val] - parser.add_argument(*opt.cli, dest=val, **opt.kwargs) + options = deepcopy(opt.kwargs) + help_text = options.pop("help", None) + if opt.fthelp and isinstance(opt.fthelp, dict): + help_text = opt.fthelp.get(parser.prog, help_text) + parser.add_argument(*opt.cli, dest=val, help=help_text, **options) def _build_subcommands(self) -> None: """ diff --git a/freqtrade/commands/cli_options.py b/freqtrade/commands/cli_options.py index c256c46f3..ebc221523 100755 --- a/freqtrade/commands/cli_options.py +++ b/freqtrade/commands/cli_options.py @@ -38,8 +38,14 @@ def check_int_nonzero(value: str) -> int: class Arg: # Optional CLI arguments - def __init__(self, *args, **kwargs): + def __init__(self, *args, fthelp: dict[str, str] | None = None, **kwargs): + """ + CLI Arguments - used to build subcommand parsers consistently. + :param fthelp: dict - fthelp per command - should be "freqtrade ": help_text + If not provided or not found, 'help' from kwargs is used instead. + """ self.cli = args + self.fthelp = fthelp self.kwargs = kwargs @@ -422,6 +428,14 @@ AVAILABLE_CLI_OPTIONS = { ), "candle_types": Arg( "--candle-types", + fthelp={ + "freqtrade download-data": ( + "Select candle type to download. " + "Defaults to the necessary candles for the selected trading mode " + "(e.g. 'spot' or ('futures', 'funding_rate' and 'mark') for futures)." + ), + "_": "Select candle type to convert. Defaults to all available types.", + }, help="Select candle type to convert. Defaults to all available types.", choices=[c.value for c in CandleType], nargs="+",