Add Custom message during transition period
This commit is contained in:
parent
0aa73d5b35
commit
9ef874e979
@ -74,8 +74,9 @@ class Arguments:
|
|||||||
# Workaround issue in argparse with action='append' and default value
|
# Workaround issue in argparse with action='append' and default value
|
||||||
# (see https://bugs.python.org/issue16399)
|
# (see https://bugs.python.org/issue16399)
|
||||||
# Allow no-config for certain commands (like downloading / plotting)
|
# Allow no-config for certain commands (like downloading / plotting)
|
||||||
if (parsed_arg.config is None and ((Path.cwd() / constants.DEFAULT_CONFIG).is_file() or
|
if ('config' in parsed_arg and parsed_arg.config is None and
|
||||||
not ('command' in parsed_arg and parsed_arg.command in NO_CONF_REQURIED))):
|
((Path.cwd() / constants.DEFAULT_CONFIG).is_file() or
|
||||||
|
not ('command' in parsed_arg and parsed_arg.command in NO_CONF_REQURIED))):
|
||||||
parsed_arg.config = [constants.DEFAULT_CONFIG]
|
parsed_arg.config = [constants.DEFAULT_CONFIG]
|
||||||
|
|
||||||
return parsed_arg
|
return parsed_arg
|
||||||
@ -97,15 +98,18 @@ class Arguments:
|
|||||||
self._build_args(optionlist=ARGS_COMMON, parser=group)
|
self._build_args(optionlist=ARGS_COMMON, parser=group)
|
||||||
|
|
||||||
# Build main command
|
# Build main command
|
||||||
self.parser = argparse.ArgumentParser(description='Free, open source crypto trading bot',
|
self.parser = argparse.ArgumentParser(description='Free, open source crypto trading bot')
|
||||||
parents=[_common_parser])
|
|
||||||
|
|
||||||
from freqtrade.optimize import start_backtesting, start_hyperopt, start_edge
|
from freqtrade.optimize import start_backtesting, start_hyperopt, start_edge
|
||||||
from freqtrade.utils import (start_create_userdir, start_download_data,
|
from freqtrade.utils import (start_create_userdir, start_download_data,
|
||||||
start_list_exchanges, start_trading)
|
start_list_exchanges, start_trading)
|
||||||
from freqtrade.plot.plot_utils import start_plot_dataframe, start_plot_profit
|
from freqtrade.plot.plot_utils import start_plot_dataframe, start_plot_profit
|
||||||
|
|
||||||
subparsers = self.parser.add_subparsers(dest='command', required=True)
|
subparsers = self.parser.add_subparsers(dest='command',
|
||||||
|
# Use custom message when no subhandler is added
|
||||||
|
# shown from `main.py`
|
||||||
|
# required=True
|
||||||
|
)
|
||||||
|
|
||||||
# Add trade subcommand
|
# Add trade subcommand
|
||||||
trade_cmd = subparsers.add_parser('trade', help='Trade module.',
|
trade_cmd = subparsers.add_parser('trade', help='Trade module.',
|
||||||
|
@ -35,6 +35,13 @@ def main(sysargv: List[str] = None) -> None:
|
|||||||
# Call subcommand.
|
# Call subcommand.
|
||||||
if 'func' in args:
|
if 'func' in args:
|
||||||
return_code = args['func'](args)
|
return_code = args['func'](args)
|
||||||
|
else:
|
||||||
|
# No subcommand was issued.
|
||||||
|
raise OperationalException(
|
||||||
|
"Usage of freqtrade requires a subcommand.\n"
|
||||||
|
"To use the previous behaviour, run freqtrade with `freqtrade trade [...]`.\n"
|
||||||
|
"To see a full list of options, please use `freqtrade --help`"
|
||||||
|
)
|
||||||
|
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
return_code = e
|
return_code = e
|
||||||
|
Loading…
Reference in New Issue
Block a user