





















@@ -41,13 +41,51 @@ const DEFAULT_GITHUB_WORKFLOW = "openclaw-live-and-e2e-checks-reusable.yml";
4141const IS_MAIN = process.argv[1]
4242 ? path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)
4343 : false;
44-const cliArgs = new Set(IS_MAIN ? process.argv.slice(2) : []);
45-if (IS_MAIN) {
46-for (const arg of cliArgs) {
47-if (arg !== "--plan-json") {
48-throw new Error(`unknown argument: ${arg}`);
44+45+export function dockerAllUsage() {
46+return [
47+"Usage: node scripts/test-docker-all.mjs [--plan-json]",
48+"",
49+"Options:",
50+" --plan-json Print the resolved Docker E2E plan as JSON and exit.",
51+" -h, --help Show this help.",
52+"",
53+"Lane selection and scheduler settings are configured with OPENCLAW_DOCKER_ALL_* env vars.",
54+].join("\n");
55+}
56+57+export function parseDockerAllCliArgs(argv) {
58+const options = {
59+help: false,
60+planJson: false,
61+};
62+for (const arg of argv) {
63+if (arg === "--plan-json") {
64+options.planJson = true;
65+} else if (arg === "--help" || arg === "-h") {
66+options.help = true;
67+} else {
68+throw new Error(`unknown argument: ${arg}\n\n${dockerAllUsage()}`);
4969}
5070}
71+return options;
72+}
73+74+let cliOptions = {
75+help: false,
76+planJson: false,
77+};
78+if (IS_MAIN) {
79+try {
80+cliOptions = parseDockerAllCliArgs(process.argv.slice(2));
81+} catch (error) {
82+console.error(error instanceof Error ? error.message : String(error));
83+process.exit(1);
84+}
85+if (cliOptions.help) {
86+console.log(dockerAllUsage());
87+process.exit(0);
88+}
5189}
52905391function parsePositiveInt(raw, fallback, label) {
@@ -1107,7 +1145,7 @@ async function main() {
11071145const timingsEnabled = parseBool(process.env.OPENCLAW_DOCKER_ALL_TIMINGS, true);
11081146const buildEnabled = parseBool(process.env.OPENCLAW_DOCKER_ALL_BUILD, true);
11091147const planJson =
1110-cliArgs.has("--plan-json") || parseBool(process.env.OPENCLAW_DOCKER_ALL_PLAN_JSON, false);
1148+cliOptions.planJson || parseBool(process.env.OPENCLAW_DOCKER_ALL_PLAN_JSON, false);
11111149const planReleaseAll = parseBool(process.env.OPENCLAW_DOCKER_ALL_PLAN_RELEASE_ALL, false);
11121150const profile = parseProfile(process.env.OPENCLAW_DOCKER_ALL_PROFILE);
11131151const releaseProfile = normalizeReleaseProfile(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。