mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 01:08:07 +00:00
feat: 在文档中添加 CLI 参数说明,支持通过命令行临时指定交易所
This commit is contained in:
@@ -4,9 +4,17 @@ import { App } from "./ui/App";
|
||||
import { setupGlobalErrorHandlers } from "./runtime-errors";
|
||||
import { parseCliArgs, printCliHelp } from "./cli/args";
|
||||
import { startStrategy } from "./cli/strategy-runner";
|
||||
import { resolveExchangeId } from "./exchanges/create-adapter";
|
||||
|
||||
setupGlobalErrorHandlers();
|
||||
const options = parseCliArgs();
|
||||
// If user specifies --exchange, override environment-based resolution for this process
|
||||
if (options.exchange) {
|
||||
// Ensure downstream calls to resolveExchangeId() pick the CLI value.
|
||||
// We set both common env keys respected by resolveExchangeId.
|
||||
process.env.EXCHANGE = options.exchange;
|
||||
process.env.TRADE_EXCHANGE = options.exchange;
|
||||
}
|
||||
|
||||
if (options.help) {
|
||||
printCliHelp();
|
||||
|
||||
Reference in New Issue
Block a user