惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
量子位
Recent Announcements
Recent Announcements
T
The Blog of Author Tim Ferriss
美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
V
Visual Studio Blog
博客园 - 聂微东
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
U
Unit 42
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
L
LangChain Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(scripts): reject short flag values in helper CLIs · o...
vincentkoc · 2026-06-22 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -13,7 +13,7 @@ import {

1313
1414

function readPackageArgValue(argv, index) {

1515

const value = argv[index + 1];

16-

if (value === undefined || value === "" || value.startsWith("--")) {

16+

if (value === undefined || value === "" || value.startsWith("-")) {

1717

throw new Error("missing value for --package");

1818

}

1919

return value;

Original file line numberDiff line numberDiff line change

@@ -223,7 +223,7 @@ function parseArgs(argv: string[]): ScriptOptions {

223223
224224

if (arg === "--limit") {

225225

const next = argv[index + 1];

226-

if (!next || next.startsWith("--") || !/^\d+$/u.test(next)) {

226+

if (!next || next.startsWith("-") || !/^\d+$/u.test(next)) {

227227

throw new Error("Missing/invalid --limit value");

228228

}

229229

const parsed = Number(next);

@@ -237,7 +237,7 @@ function parseArgs(argv: string[]): ScriptOptions {

237237
238238

if (arg === "--model") {

239239

const next = argv[index + 1];

240-

if (!next || next.startsWith("--")) {

240+

if (!next || next.startsWith("-")) {

241241

throw new Error("Missing --model value");

242242

}

243243

model = next;

Original file line numberDiff line numberDiff line change

@@ -307,7 +307,7 @@ function readPackageDirArg(argv) {

307307

if (packageDir === "--help" || packageDir === "-h") {

308308

return { help: true, packageDir: "" };

309309

}

310-

if (!packageDir || packageDir.startsWith("--")) {

310+

if (!packageDir || packageDir.startsWith("-")) {

311311

throw new Error(usage());

312312

}

313313

const extraArg = args[1];

Original file line numberDiff line numberDiff line change

@@ -5,7 +5,7 @@ import { fileURLToPath } from "node:url";

55

import { normalizeUpgradeSurvivorBaselineSpec } from "./lib/docker-e2e-plan.mjs";

66

import { compareReleaseVersions, parseReleaseVersion } from "./lib/npm-publish-plan.mjs";

77
8-

function parseArgs(argv) {

8+

export function parseArgs(argv) {

99

const args = new Map();

1010

for (let index = 0; index < argv.length; index += 1) {

1111

const arg = argv[index];

@@ -14,7 +14,7 @@ function parseArgs(argv) {

1414

}

1515

const key = arg.slice(2);

1616

const value = argv[index + 1];

17-

if (value === undefined || value.startsWith("--")) {

17+

if (value === undefined || value.startsWith("-")) {

1818

throw new Error(`missing value for --${key}`);

1919

}

2020

args.set(key, value);

Original file line numberDiff line numberDiff line change

@@ -24,9 +24,11 @@ describe("label-open-issues helpers", () => {

2424

});

2525
2626

expect(() => testing.parseArgs(["--model", "--dry-run"])).toThrow("Missing --model value");

27+

expect(() => testing.parseArgs(["--model", "-h"])).toThrow("Missing --model value");

2728

expect(() => testing.parseArgs(["--limit", "--dry-run"])).toThrow(

2829

"Missing/invalid --limit value",

2930

);

31+

expect(() => testing.parseArgs(["--limit", "-h"])).toThrow("Missing/invalid --limit value");

3032

expect(() => testing.parseArgs(["--wat"])).toThrow("Unknown argument: --wat");

3133

});

3234
Original file line numberDiff line numberDiff line change

@@ -39,6 +39,7 @@ describe("plugin npm runtime build args", () => {

3939

expect(() => parseBulkBuildArgs(["--package", "--package", "extensions/slack"])).toThrow(

4040

"missing value for --package",

4141

);

42+

expect(() => parseBulkBuildArgs(["--package", "-h"])).toThrow("missing value for --package");

4243

expect(() => parseSingleBuildArgs(["--package"])).toThrow(

4344

"usage: node scripts/lib/plugin-npm-runtime-build.mjs <package-dir>",

4445

);

Original file line numberDiff line numberDiff line change

@@ -3,7 +3,7 @@ import { mkdtempSync, rmSync, writeFileSync } from "node:fs";

33

import { tmpdir } from "node:os";

44

import path from "node:path";

55

import { describe, expect, it } from "vitest";

6-

import { resolveBaselines } from "../../scripts/resolve-upgrade-survivor-baselines.mjs";

6+

import { parseArgs, resolveBaselines } from "../../scripts/resolve-upgrade-survivor-baselines.mjs";

77
88

function withReleaseFixture<T>(releases: unknown[], fn: (file: string) => T): T {

99

const dir = mkdtempSync(path.join(tmpdir(), "openclaw-upgrade-baselines-"));

@@ -28,6 +28,11 @@ function withJsonFixture<T>(name: string, contents: unknown, fn: (file: string)

2828

}

2929
3030

describe("scripts/resolve-upgrade-survivor-baselines", () => {

31+

it("rejects short flag values before resolving baselines", () => {

32+

expect(() => parseArgs(["--fallback", "-h"])).toThrow("missing value for --fallback");

33+

expect(() => parseArgs(["--github-output", "-h"])).toThrow("missing value for --github-output");

34+

});

35+
3136

it("keeps the single fallback baseline when no expanded request is provided", () => {

3237

expect(resolveBaselines(new Map([["fallback", "2026.4.23"]]))).toEqual(["openclaw@2026.4.23"]);

3338

});