feat: 在文档中添加 CLI 参数说明,支持通过命令行临时指定交易所

This commit is contained in:
discountry
2025-10-03 03:16:44 +08:00
parent 9a419c36ac
commit b43eaa0c64
5 changed files with 72 additions and 5 deletions
+8
View File
@@ -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();